om = $om; $this->repository = $repo; $this->publisher = $publisher; } public function create($eventName, $type, array $data, array $collectionBaseIds = array()) { $event = new WebhookEvent(); $event->setName($eventName); $event->setType($type); $event->setData($data); if (count($collectionBaseIds) > 0) { $event->setCollectionBaseIds($collectionBaseIds); } $this->update($event); $this->publisher->publishWebhookEvent($event); return $event; } public function delete(WebhookEvent $event) { $this->om->remove($event); $this->om->flush(); } public function update(WebhookEvent $event) { try { $this->om->persist($event); $this->om->flush(); } catch (\Exception $e) { } } public function processed(WebhookEvent $event) { $event->setProcessed(true); $this->update($event); } }