public function handleVendingMachineEventData(VendingMachine $vendingMachine, $data)
 {
     $eventsArray = [];
     foreach ($data[self::SYNC_DATA][VendingMachineEvent::getSyncArrayName()] as $value) {
         $vendingMachineEvent = (new VendingMachineEvent())->setSyncEventId($value[VendingMachineEvent::VENDING_MACHINE_EVENT_ID])->setOccurredAt($value[VendingMachineEvent::VENDING_MACHINE_EVENT_DATETIME])->setType($value[VendingMachineEvent::VENDING_MACHINE_EVENT_TYPE])->setCode($value[VendingMachineEvent::VENDING_MACHINE_EVENT_CODE])->setMessage($value[VendingMachineEvent::VENDING_MACHINE_EVENT_MESSAGE]);
         $vendingMachineEvent->setVendingMachine($vendingMachine);
         $eventsArray[] = $vendingMachineEvent;
     }
     // if events empty will except
     $this->_manager->getRepository('AppBundle:VendingMachine\\VendingMachineEvent')->rawInsertVendingMachineEvents($eventsArray);
 }
 /**
  * Add vendingMachineEvent
  *
  * @param \AppBundle\Entity\VendingMachine\VendingMachineEvent $vendingMachineEvent
  * @return VendingMachine
  */
 public function addVendingMachineEvent(\AppBundle\Entity\VendingMachine\VendingMachineEvent $vendingMachineEvent)
 {
     $vendingMachineEvent->setVendingMachine($this);
     $this->vendingMachineEvents[] = $vendingMachineEvent;
     return $this;
 }