1 | <?php |
||
5 | trait CacheableTrait |
||
6 | { |
||
7 | /** |
||
8 | * Get the base class name, without 'Repository' suffix. |
||
9 | * |
||
10 | * @return string |
||
11 | */ |
||
12 | protected function baseClassName() |
||
22 | |||
23 | /** |
||
24 | * Return the cache duration value |
||
25 | * which would be used by the repository. |
||
26 | * |
||
27 | * @return int |
||
28 | */ |
||
29 | public function cacheDuration() |
||
37 | |||
38 | /** |
||
39 | * Return an array of method names which |
||
40 | * you don't wish to be cached. |
||
41 | * |
||
42 | * @return array |
||
43 | */ |
||
44 | public function cacheExcept() |
||
54 | |||
55 | /** |
||
56 | * Generate cache key. |
||
57 | * |
||
58 | * @param string $method |
||
59 | * @param mixed $args |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | public function cacheKey($method, $args) |
||
70 | |||
71 | /** |
||
72 | * Return the cache tags which would |
||
73 | * be used by the repository. |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function cacheTags() |
||
85 | |||
86 | /** |
||
87 | * Return the primary model object which would |
||
88 | * be used by the repository. |
||
89 | * |
||
90 | * @return \Suitmedia\Cacheable\Contracts\CacheableModel |
||
91 | */ |
||
92 | abstract public function model(); |
||
93 | } |
||
94 |