public function onRawEventAdd(NewRawEventEvent $rawEventEvent) { $rawEvent = $rawEventEvent->getRawEvent(); $eventIdentifier = $this->doctrineManager->getRepository('KoalamonIncidentDashboardBundle:EventIdentifier')->findOneBy(['identifier' => $rawEvent->getIdentifier(), 'project' => $rawEventEvent->getProject()]); if (!$eventIdentifier) { $system = $this->doctrineManager->getRepository('KoalamonIncidentDashboardBundle:System')->findOneBy(['identifier' => $rawEvent->getSystem()]); $eventIdentifier = new EventIdentifier(); $eventIdentifier->setIdentifier($rawEvent->getIdentifier()); $eventIdentifier->setSystem($system); $eventIdentifier->setProject($rawEventEvent->getProject()); $this->doctrineManager->persist($eventIdentifier); $this->doctrineManager->flush(); } $rawEventEvent->getEvent()->setEventIdentifier($eventIdentifier); }
public function onRawEventAdd(NewRawEventEvent $rawEventEvent) { $rawEvent = $rawEventEvent->getRawEvent(); $tool = $this->doctrineManager->getRepository('KoalamonIncidentDashboardBundle:Tool')->findOneByIdentifier($rawEvent->getType(), $rawEventEvent->getProject()); if (!$tool) { $tool = new Tool(); $tool->setName($rawEvent->getType()); $tool->setIdentifier($rawEvent->getType()); $tool->setProject($rawEventEvent->getProject()); $this->doctrineManager->persist($tool); $this->doctrineManager->flush(); $this->eventDispatcher->dispatch('koalamon.tool.create', new NewToolEvent($tool, true)); } $rawEventEvent->getEvent()->setType($rawEvent->getType()); $rawEventEvent->getEvent()->getEventIdentifier()->setTool($tool); }
public function onRawEventAdd(NewRawEventEvent $rawEventEvent) { $rawEvent = $rawEventEvent->getRawEvent(); $system = $this->doctrineManager->getRepository('KoalamonIncidentDashboardBundle:System')->findOneBy(['identifier' => $rawEvent->getSystem(), 'project' => $rawEventEvent->getProject()]); if (!$system) { $system = new System(); $system->setName($rawEvent->getSystem()); $system->setIdentifier($rawEvent->getSystem()); $system->setProject($rawEventEvent->getProject()); $this->doctrineManager->persist($system); $this->doctrineManager->flush(); $this->eventDispatcher->dispatch('koalamon.system.create', new NewSystemEvent($system, true)); } $rawEventEvent->getEvent()->setSystem($rawEvent->getSystem()); $rawEventEvent->getEvent()->getEventIdentifier()->setSystem($system); }