| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class TrickEditedSubscriber extends TrickSubscriber implements EventSubscriberInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Send trick to the database and set a flash message |
||
| 13 | * @param TrickEditedEvent $event |
||
| 14 | */ |
||
| 15 | public function updateTrickInDatabase(TrickEditedEvent $event) |
||
| 16 | { |
||
| 17 | $trick = $event->getEntity(); |
||
| 18 | $this->sendToDatabase($event); |
||
| 19 | $this->addFlash(FlashMessageCategory::SUCCESS, 'Trick ' . $trick->getName() . ' updated'); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return array The event names to listen to |
||
| 24 | */ |
||
| 25 | public static function getSubscribedEvents() |
||
| 29 | ]; |
||
| 30 | } |
||
| 31 | } |