Total Complexity | 4 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class TimestampedEntitySubscriber implements EntitySubscriberInterface |
||
10 | { |
||
11 | public function supportsEntity($entity = null): bool |
||
12 | { |
||
13 | return $entity instanceof TimestampedEntityInterface; |
||
14 | } |
||
15 | |||
16 | public function getSubscribedEvents(): array |
||
17 | { |
||
18 | return [ |
||
19 | Events::prePersist |
||
20 | ]; |
||
21 | } |
||
22 | |||
23 | public function prePersist(LifecycleEventArgs $args, TimestampedEntityInterface $entity): void |
||
30 | } |
||
31 | } |
||
32 |