Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class RoleObserverClearCache |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * @var Repository |
||
14 | */ |
||
15 | private $cache; |
||
16 | |||
17 | 7 | public function __construct(Repository $cache) |
|
18 | { |
||
19 | 7 | $this->cache = $cache; |
|
20 | 7 | } |
|
21 | |||
22 | 2 | public function create(RoleModel $roleModel) |
|
26 | 2 | } |
|
27 | |||
28 | 1 | public function delete(RoleModel $role) |
|
29 | { |
||
30 | 1 | $this->cache->forget(RoleCache::class . '@count'); |
|
31 | 1 | $this->cache->forget(RoleCache::class . '@getById:' . $role->id()); |
|
32 | 1 | $this->cache->forget(RoleCache::class . '@getByDataProviderId:' . $role->dataProviderId()); |
|
33 | 1 | $this->cache->forget(RoleCache::class . '@allThroughGroup:' . $role->groupId()); |
|
34 | 1 | $this->cache->forget(RoleCache::class . '@allThroughPosition:' . $role->positionId()); |
|
35 | 1 | } |
|
36 | |||
37 | 4 | public function update(RoleModel $oldRole, RoleModel $newRole) |
|
47 | 4 | } |
|
48 | |||
49 | } |