From 546daa78721e6abdbc89afcecc158118c2239865 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Wed, 26 Apr 2023 21:43:02 +0300 Subject: alfa.3 version; backend designer and front-end embeder enabled --- public/app/extends/Cache_service.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'public/app/extends/Cache_service.php') 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 -- cgit v1.2.3