| @@ 291-305 (lines=15) @@ | ||
| 288 | /** |
|
| 289 | * @param EntityInterface $createdEntity |
|
| 290 | */ |
|
| 291 | protected function triggerCreate(EntityInterface &$createdEntity) |
|
| 292 | { |
|
| 293 | $this->eventManager->addIdentifiers([get_class($createdEntity)]); |
|
| 294 | ||
| 295 | $event = new Event( |
|
| 296 | sprintf('entity:%s:created', get_class($createdEntity)), |
|
| 297 | $this, |
|
| 298 | ['entity' => $createdEntity] |
|
| 299 | ); |
|
| 300 | $this->eventManager->triggerEvent($event); |
|
| 301 | ||
| 302 | if ($event->getParam('entity') && $event->getParam('entity') instanceof EntityInterface) { |
|
| 303 | $createdEntity = $event->getParam('entity'); |
|
| 304 | } |
|
| 305 | } |
|
| 306 | ||
| 307 | /** |
|
| 308 | * @param EntityInterface $deletedEntity |
|
| @@ 299-313 (lines=15) @@ | ||
| 296 | /** |
|
| 297 | * @param EntityInterface $createdEntity |
|
| 298 | */ |
|
| 299 | protected function triggerCreate(EntityInterface &$createdEntity) |
|
| 300 | { |
|
| 301 | $this->eventManager->addIdentifiers([get_class($createdEntity)]); |
|
| 302 | ||
| 303 | $event = new Event( |
|
| 304 | sprintf('entity:%s:created', get_class($createdEntity)), |
|
| 305 | $this, |
|
| 306 | ['entity' => $createdEntity] |
|
| 307 | ); |
|
| 308 | $this->eventManager->triggerEvent($event); |
|
| 309 | ||
| 310 | if ($event->getParam('entity') && $event->getParam('entity') instanceof EntityInterface) { |
|
| 311 | $createdEntity = $event->getParam('entity'); |
|
| 312 | } |
|
| 313 | } |
|
| 314 | ||
| 315 | /** |
|
| 316 | * @param EntityInterface $deletedEntity |
|