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.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/public/app/extends/Cache_service.php b/public/app/extends/Cache_service.php
index 9aac1d0..52311f3 100644
--- a/public/app/extends/Cache_service.php
+++ b/public/app/extends/Cache_service.php
@@ -45,5 +45,38 @@ class Cache_service
);
}
+ public static function pages_list( $options = 0 )
+ {
+ return proxy(
+ [\app\models\cms\Course_model::class, 'pages'],
+ [], CACHE_ROOT_TTL,
+ $options
+ );
+ }
+
+
+ /** entity
+ *
+ * create and retrieve a cached array of some entity
+ *
+ * @param $entiry (string|method): method of the main CMS model
+ * NOTE: CRITICAL: method must exist in the main CMS model
+ */
+ public static function entity( $entity, $options = 0 )
+ {
+ $allowed_methods = [ // to make sure method existence
+ 'page',
+ 'course',
+ 'lesson',
+ ];
+
+ // TODO: needs testing before release
+ // return proxy(
+ // [\app\models\admin\Course_model::class, $entity],
+ // [], CACHE_ROOT_TTL,
+ // $options
+ // );
+ }
+
} \ No newline at end of file