blob: e44cc8e15c8793669992fadcb16d150867eb8b53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
);
}
}
|