saveEntities([$stat]); } /** * @param Stat[] $stats */ public function saveEntities(array $stats): void { $event = new EmailStatEvent($stats); $this->dispatcher->dispatch($event, EmailEvents::ON_EMAIL_STAT_PRE_SAVE); $this->getRepository()->saveEntities($stats); $this->dispatcher->dispatch($event, EmailEvents::ON_EMAIL_STAT_POST_SAVE); } public function getRepository(): StatRepository { return $this->entityManager->getRepository(Stat::class); } }