summaryrefslogtreecommitdiff
path: root/public/app/extends/Cache_service.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/extends/Cache_service.php')
-rw-r--r--public/app/extends/Cache_service.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/public/app/extends/Cache_service.php b/public/app/extends/Cache_service.php
new file mode 100644
index 0000000..e44cc8e
--- /dev/null
+++ b/public/app/extends/Cache_service.php
@@ -0,0 +1,45 @@
+<?php
+namespace app\extends;
+
+use app\models\cms\Course_model;
+use app\models\admin\Privilege_model;
+
+/** Cache service
+ * -----------------------------------------------------------------------------
+ *
+ * class that gathers common source-expensive queries
+ * and helps for performance optimization
+ *
+ */
+class Cache_service
+{
+
+ public static function courses_struct( $options = 0 )
+ {
+ return proxy( // cache-get categories
+ [\app\models\cms\Course_model::class, 'courses_struct'],
+ [], CACHE_ROOT_TTL, $options
+ );
+ }
+
+ public static function files_attributes( $options = 0 )
+ {
+ return proxy(
+ [\app\models\cms\Course_model::class, 'files'],
+ [], CACHE_ROOT_TTL, $options
+ );
+ }
+
+
+ public static function privileges_hierarchy( $options = 0 )
+ {
+ return proxy(
+ [\app\models\admin\Privilege_model::class, 'privileges'],
+ [], CACHE_ROOT_TTL, $options
+ );
+ }
+
+
+
+
+} \ No newline at end of file