| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 42 | public function clearContainers(HttpCacheEvent $event) |
||
| 43 | { |
||
| 44 | $this->cacheManager->invalidateRoute('swp_api_templates_list_containers'); |
||
| 45 | if ($event->getSubject() instanceof Container) { |
||
| 46 | $this->cacheManager->invalidateRoute('swp_api_templates_get_container', [ |
||
| 47 | 'id' => $event->getSubject()->getId(), |
||
| 48 | ]); |
||
| 49 | } |
||
| 50 | |||
| 51 | try { |
||
| 52 | $this->cacheManager->flush(); |
||
| 53 | } catch (ExceptionCollection $e) { |
||
| 54 | $this->logger->error($e->getMessage()); |
||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 |