1 | <?php |
||
13 | final class Validation implements EventSubscriber |
||
14 | { |
||
15 | /** |
||
16 | * @inheritDoc |
||
17 | */ |
||
18 | 138 | public function getSubscribedEvents(): array |
|
25 | |||
26 | /** |
||
27 | * @param PreUpdateEventArgs $args |
||
28 | * @throws ValidationException |
||
29 | */ |
||
30 | 18 | public function preUpdate(PreUpdateEventArgs $args): void |
|
37 | |||
38 | /** |
||
39 | * @param LifecycleEventArgs $args |
||
40 | * @throws ValidationException |
||
41 | */ |
||
42 | 38 | public function prePersist(LifecycleEventArgs $args): void |
|
49 | |||
50 | /** |
||
51 | * Check if object should be handled |
||
52 | * |
||
53 | * @param object $entity |
||
54 | * @return bool |
||
55 | */ |
||
56 | 54 | private function shouldHandle($entity): bool |
|
60 | |||
61 | /** |
||
62 | * @param DbConfiguration $configuration |
||
63 | * @throws ValidationException |
||
64 | */ |
||
65 | 12 | private function validate(DbConfiguration $configuration): void |
|
92 | } |
||
93 |