Esempio n. 1
0
 public function process(AccountingEvent $accountingEvent, LedgerTransaction $ledgerTransaction)
 {
     $context = new TransactionContext($accountingEvent->getMemorandum(), $accountingEvent, $ledgerTransaction);
     $error = new ErrorCollection();
     $occuredDate = clone $accountingEvent->getOccuredDate();
     # filter rules for event occure date
 }
 /**
  *  Receive an accounting Event and store it
  *
  *  @access public
  *  @return void
  *
  */
 public function receive(AccountingEvent $event)
 {
     try {
         # fire the event received
         $this->eventDispatcher->dispatch(EventStoreEvents::EVENT_RECEIVED, new EventStoreEvent($event));
         $success = $this->eventGateway->insertQuery()->start()->addColumn('username', 'ausername')->end()->insert();
         # update entity with new id
         if ($success) {
             $event->setEventId($this->eventGateway->lastInsertId());
         }
         # dispatch event
         $this->eventDispatcher->dispatch(EventStoreEvents::EVENT_SAVED, new EventStoreEvent($event));
     } catch (DBALException $e) {
         $this->eventDispatcher->dispatch(EventStoreEvents::EVENT_ERROR, new EventStoreEvent($event), $e->getMessage());
         # throw exception
         throw new LedgerException($e->getMessage(), 0, $e);
     }
 }