| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | abstract class EntityNotificationProcessor extends NotificationProcessor |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * The repository needs to be injected in the child class. |
||
| 27 | * |
||
| 28 | * @var EntityNotificationRepository |
||
| 29 | */ |
||
| 30 | protected $notificationRepository; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param EventDefinition $definition |
||
| 34 | * @return Notification[] |
||
| 35 | */ |
||
| 36 | public function getNotificationsFromEventDefinition(EventDefinition $definition) |
||
| 37 | { |
||
| 38 | return $this->notificationRepository |
||
| 39 | ->findFromEventDefinition($definition) |
||
| 40 | ->toArray(); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return Notification[] |
||
| 45 | */ |
||
| 46 | public function getAllNotifications() |
||
| 47 | { |
||
| 48 | return $this->notificationRepository |
||
| 49 | ->findAll() |
||
| 50 | ->toArray(); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | public function getTotalNumber() |
||
| 61 | } |
||
| 62 | } |
||
| 63 |