/**
  * @param ContentEvent $event
  */
 public function addContentTrashCan(ContentEvent $event)
 {
     $content = $event->getContent();
     $name = $content->getName();
     $type = ContentInterface::TRASH_ITEM_TYPE;
     $this->createTrashItem($content, $name, $type);
 }
 /**
  * @param ContentEvent $event
  */
 public function invalidateCacheOnUpdatePublishedContent(ContentEvent $event)
 {
     $content = $event->getContent();
     $previousStatus = $event->getPreviousStatus();
     if ($previousStatus instanceof StatusInterface && $previousStatus->isPublished()) {
         $this->cacheableManager->invalidateTags(array($this->tagManager->formatContentIdTag($content->getContentId())));
     }
 }
 /**
  * @param ContentEvent $event
  *
  * @throws IndexorWrongParameterException
  */
 public function restoreIndexedContent(ContentEvent $event)
 {
     $this->contentIndexor->index($event->getContent());
 }
 /**
  * @param ContentEvent $event
  */
 public function contentChangeStatus(ContentEvent $event)
 {
     $this->sendLog('open_orchestra_log.content.status', $event->getContent());
 }
 /**
  * @param ContentEvent $event
  */
 public function updateReferencesToContent(ContentEvent $event)
 {
     $content = $event->getContent();
     $this->referenceManager->updateReferencesToEntity($content);
 }
 /**
  * @param ContentEvent $event
  * @param string       $eventType
  */
 protected function addContentHistory(ContentEvent $event, $eventType)
 {
     $document = $event->getContent();
     $token = $this->tokenManager->getToken();
     if ($document instanceof HistorisableInterface && !is_null($token)) {
         $this->addDocumentHistory($document, $token, $eventType);
     }
 }