@@ 71-80 (lines=10) @@ | ||
68 | * delete all cache from the class |
|
69 | * @return bool |
|
70 | */ |
|
71 | public function forgetCache() |
|
72 | { |
|
73 | $cacheName = self::_getCacheKeyPrefixLevel1() . '*'; |
|
74 | $redis = Cache::getRedis(); |
|
75 | $keys = $redis->keys($cacheName); |
|
76 | if ($keys) { |
|
77 | $redis->del($keys); |
|
78 | }; |
|
79 | return true; |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * delete all cache from method |
|
@@ 87-95 (lines=9) @@ | ||
84 | * @param $method |
|
85 | * @return bool |
|
86 | */ |
|
87 | public function forgetMethodCache($method){ |
|
88 | $cacheName = self::_getCacheKeyPrefixLevel2($method) . '*'; |
|
89 | $redis = Cache::getRedis(); |
|
90 | $keys = $redis->keys($cacheName); |
|
91 | if ($keys) { |
|
92 | $redis->del($keys); |
|
93 | }; |
|
94 | return true; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * get cache level1 prefix |