/**
  * @param NodeEvent $event
  */
 public function addNodeTrashCan(NodeEvent $event)
 {
     $node = $event->getNode();
     $name = $node->getName() . " (" . $node->getLanguage() . " - #" . $node->getVersion() . ")";
     $type = NodeInterface::TRASH_ITEM_TYPE;
     $this->createTrashItem($node, $name, $type);
 }
 /**
  * @param NodeEvent $event
  */
 public function updatePath(NodeEvent $event)
 {
     $node = $event->getNode();
     $parentPath = $node->getPath();
     $siteId = $this->currentSiteManager->getCurrentSiteId();
     $sons = $this->nodeRepository->findByParent($node->getNodeId(), $siteId);
     $sonsToUpdate = array();
     foreach ($sons as $son) {
         $son->setPath($parentPath . '/' . $son->getNodeId());
         $sonsToUpdate[$son->getNodeId()] = $son;
     }
     foreach ($sonsToUpdate as $sonToUpdate) {
         $event = new NodeEvent($sonToUpdate);
         $this->eventDispatcher->dispatch(NodeEvents::PATH_UPDATED, $event);
     }
 }
 /**
  * @param NodeEvent $event
  */
 public function updateRouteDocument(NodeEvent $event)
 {
     $this->updateRouteDocumentByType($event->getNode(), 'Node');
 }
 /**
  * @param NodeEvent $event
  */
 public function nodeChangeStatus(NodeEvent $event)
 {
     $this->info('open_orchestra_log.node.status', $event->getNode());
 }
 /**
  * @param NodeEvent $event
  */
 public function updateRedirectionRoutesOnNodeDelete(NodeEvent $event)
 {
     $node = $event->getNode();
     $this->deleteRedirectionForNodeTree($node);
 }
 /**
  * Triggered when a node status changes
  *
  * @param NodeEvent $event
  */
 public function invalidateNodeTag(NodeEvent $event)
 {
     $node = $event->getNode();
     $siteId = $node->getSiteId();
     $this->cacheableManager->invalidateTags(array($this->tagManager->formatMenuTag($siteId)));
 }
 /**
  * @param NodeEvent $event
  *
  * @throws IndexorWrongParameterException
  */
 public function restoreIndexedNode(NodeEvent $event)
 {
     $this->nodeIndexor->index($event->getNode());
 }
 /**
  * @param NodeEvent $event
  * @param string    $eventType
  */
 protected function addNodeHistory(NodeEvent $event, $eventType)
 {
     $document = $event->getNode();
     $token = $this->tokenManager->getToken();
     if ($document instanceof HistorisableInterface && !is_null($token)) {
         $this->addDocumentHistory($document, $token, $eventType);
     }
 }