| Total Complexity | 8 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class CacheHelper |
||
| 15 | { |
||
| 16 | public static function putInGroup($key, $value, $group, $duration) { |
||
| 17 | $key = md5($key); |
||
| 18 | $exist = (Cache::get($group))?:[]; |
||
| 19 | $exist[ $key ] = ['value'=>$value,'duration'=>$duration]; |
||
| 20 | |||
| 21 | if($duration == -1) { |
||
| 22 | Cache::forever($group, $exist); |
||
| 23 | } else { |
||
| 24 | Cache::put($group, $exist, $duration); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function getItemInGroup($key, $group) { |
||
| 35 | } |
||
| 36 | |||
| 37 | public static function forgetGroup($group) { |
||
| 38 | Cache::forget($group); |
||
| 39 | } |
||
| 40 | |||
| 41 | public static function forgetInGroup($key,$group) { |
||
| 51 | } |
||
| 52 | |||
| 53 | } |