1 | <?php |
||
16 | class DoctrineNotificationRepository extends EntityRepository implements NotificationRepository |
||
17 | { |
||
18 | 3 | /** |
|
19 | * @var bool |
||
20 | 3 | */ |
|
21 | 3 | private $isPrecocious; |
|
22 | 1 | ||
23 | 1 | /** |
|
24 | 1 | * @param $em |
|
25 | 1 | * @param Mapping\ClassMetadata $class |
|
26 | */ |
||
27 | public function __construct($em, Mapping\ClassMetadata $class, bool $isPrecocious) |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function add(Notification $notification, bool $precocious = false): void |
||
49 | |||
50 | /** |
||
51 | 2 | * {@inheritdoc} |
|
52 | * @throws ORMException |
||
53 | 2 | * @throws OptimisticLockException |
|
54 | 2 | */ |
|
55 | 2 | public function markSent(Notification $notification): void |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | * @throws ORMException |
||
64 | * @throws OptimisticLockException |
||
65 | */ |
||
66 | public function markFailed(Notification $notification, string $reason): void |
||
71 | |||
72 | /** |
||
73 | * @param Notification $notification |
||
74 | * @throws ORMException |
||
75 | * @throws OptimisticLockException |
||
76 | */ |
||
77 | private function persist(Notification $notification): void |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function notificationOfId(NotificationId $notificationId): ?Notification |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function hasNotificationOfDeduplicationKey(DeduplicationKey $deduplicationKey): bool |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | public function unsentNotifications(): array |
||
112 | } |
||
113 |