blob: 9aac1d0ef39eb19b53039d0ce3fe20ccd2685ac9 (
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
46
47
48
49
|
<?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
*
* when forcing cache creation the following option is used:
* $options = PROXY_IGNORE_CACHE
*
*/
class Cache_service
{
public static function courses_struct( $options = 0 )
{
return proxy( // cache-get courses
[\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
);
}
}
|