1 | <?php |
||
24 | class IndexManagerHandler implements EventHandlersInterface |
||
25 | { |
||
26 | public function setupHandlers() |
||
27 | { |
||
28 | $on = [ |
||
29 | EntityManager::EventBeforeInsert, |
||
30 | EntityManager::EventBeforeSave, |
||
31 | EntityManager::EventBeforeUpdate, |
||
32 | FinderInterface::EventBeforeFind, |
||
33 | FinderInterface::EventBeforeCount, |
||
34 | FinderInterface::EventBeforeExists, |
||
35 | ]; |
||
36 | $handler = [$this, 'handle']; |
||
37 | foreach ($on as $name) |
||
38 | { |
||
39 | Event::on(AnnotatedInterface::class, $name, $handler); |
||
40 | } |
||
41 | } |
||
42 | |||
43 | 122 | public function handle(ModelEvent $e) |
|
49 | } |