| @@ 259-273 (lines=15) @@ | ||
| 256 | /** |
|
| 257 | * @param EntityInterface $createdEntity |
|
| 258 | */ |
|
| 259 | protected function triggerCreate(EntityInterface &$createdEntity) |
|
| 260 | { |
|
| 261 | $this->eventManager->addIdentifiers(get_class($createdEntity)); |
|
| 262 | ||
| 263 | $event = new Event( |
|
| 264 | sprintf('entity:%s:created', get_class($createdEntity)), |
|
| 265 | $this, |
|
| 266 | ['entity' => $createdEntity] |
|
| 267 | ); |
|
| 268 | $this->eventManager->trigger($event); |
|
| 269 | ||
| 270 | if ($event->getParam('entity') && $event->getParam('entity') instanceof EntityInterface) { |
|
| 271 | $createdEntity = $event->getParam('entity'); |
|
| 272 | } |
|
| 273 | } |
|
| 274 | ||
| 275 | /** |
|
| 276 | * @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->trigger($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 |
|