private function dispatchEvent(string $name, EntityInterface $entity) { $reflection = new \ReflectionClass($entity); $eventName = $this->getEventName($reflection->getShortName(), $name); $event = new EntityEvent($entity); $this->eventDispatcher->dispatch($eventName, $event); }