Inheritance: extends Neos\Flow\Persistence\Doctrine\Repository
 /**
  * Add the passed event (which has been generated by generate()) to persistence.
  *
  * This only happens for top-level-events. All events which are attached to some parent event are persisted
  * together with the parent.
  *
  * @param Event $nodeEvent
  * @throws Exception
  * @return void
  * @see emit()
  */
 public function add(Event $nodeEvent)
 {
     if (!$this->isEnabled()) {
         throw new Exception('Event log not enabled', 1418464935);
     }
     if ($nodeEvent->getParentEvent() === null) {
         $this->eventRepository->add($nodeEvent);
     }
 }
Ejemplo n.º 2
0
 /**
  * Show event overview.
  * @param integer $offset
  * @param integer $limit
  * @return void
  */
 public function indexAction($offset = 0, $limit = 10)
 {
     $events = $this->eventRepository->findRelevantEventsByWorkspace($offset, $limit + 1, 'live')->toArray();
     $nextPage = null;
     if (count($events) > $limit) {
         $events = array_slice($events, 0, $limit);
         $nextPage = $this->controllerContext->getUriBuilder()->setCreateAbsoluteUri(true)->uriFor('Index', array('offset' => $offset + $limit), 'History', 'Neos.Neos');
     }
     $eventsByDate = array();
     foreach ($events as $event) {
         /* @var $event Event */
         $day = $event->getTimestamp()->format('Y-m-d');
         if (!isset($eventsByDate[$day])) {
             $eventsByDate[$day] = new EventsOnDate($event->getTimestamp());
         }
         /* @var $eventsOnThisDay EventsOnDate */
         $eventsOnThisDay = $eventsByDate[$day];
         $eventsOnThisDay->add($event);
     }
     $this->view->assignMultiple(array('eventsByDate' => $eventsByDate, 'nextPage' => $nextPage));
 }