| @@ 41-54 (lines=14) @@ | ||
| 38 | * |
|
| 39 | * @return \League\Event\EventInterface|string |
|
| 40 | */ |
|
| 41 | public function triggerBeforeSelect( |
|
| 42 | Select $query, EntityDescriptorInterface $entityDescriptor |
|
| 43 | ) { |
|
| 44 | $event = new \Slick\Orm\Event\Select( |
|
| 45 | null, |
|
| 46 | [ |
|
| 47 | 'query' => $query, |
|
| 48 | 'entityDescriptor' => $entityDescriptor |
|
| 49 | ] |
|
| 50 | ); |
|
| 51 | $event->setAction(\Slick\Orm\Event\Select::ACTION_BEFORE_SELECT); |
|
| 52 | return Orm::getEmitter($this->getEntityClassName()) |
|
| 53 | ->emit($event); |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * Emits the after select event |
|
| @@ 64-76 (lines=13) @@ | ||
| 61 | * |
|
| 62 | * @return \League\Event\EventInterface|string |
|
| 63 | */ |
|
| 64 | public function triggerAfterSelect($data, EntityCollection $entities) |
|
| 65 | { |
|
| 66 | $event = new \Slick\Orm\Event\Select( |
|
| 67 | null, |
|
| 68 | [ |
|
| 69 | 'data' => $data, |
|
| 70 | 'entityCollection' => $entities |
|
| 71 | ] |
|
| 72 | ); |
|
| 73 | $event->setAction(\Slick\Orm\Event\Select::ACTION_AFTER_SELECT); |
|
| 74 | return Orm::getEmitter($this->getEntityClassName()) |
|
| 75 | ->emit($event); |
|
| 76 | } |
|
| 77 | ||
| 78 | ||
| 79 | } |
|