| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | class Cache extends Base |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Clears the cache after deleting the item |
||
| 24 | * |
||
| 25 | * @return string|null admin output to display or null for redirecting to the list |
||
| 26 | */ |
||
| 27 | public function delete() : ?string |
||
| 28 | { |
||
| 29 | $result = $this->getClient()->delete(); |
||
| 30 | |||
| 31 | $ids = (array) $this->getView()->param( 'id' ); |
||
| 32 | $tags = array( 'product' ); |
||
| 33 | |||
| 34 | foreach( $ids as $id ) { |
||
| 35 | $tags[] = 'product-' . $id; |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->getContext()->getCache()->deleteByTags( $tags ); |
||
| 39 | |||
| 40 | return $result; |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | /** |
||
| 45 | * Clears the cache after saving the item |
||
| 46 | * |
||
| 47 | * @return string|null admin output to display or null for redirecting to the list |
||
| 48 | */ |
||
| 49 | public function save() : ?string |
||
| 61 | } |
||
| 62 | } |
||
| 63 |