/**
  * 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);
     }
 }