コード例 #1
0
ファイル: WorkflowStageSubscriber.php プロジェクト: sulu/sulu
 /**
  * Resets the workflowstage to test and the published date to null.
  *
  * @param UnpublishEvent $event
  */
 public function setWorkflowStageToTestAndResetPublishedDate(UnpublishEvent $event)
 {
     $document = $event->getDocument();
     if (!$this->supports($event)) {
         return;
     }
     $locale = $event->getLocale();
     $node = $this->defaultSession->getNode($this->documentInspector->getPath($document));
     $node->setProperty($this->propertyEncoder->localizedSystemName(self::WORKFLOW_STAGE_FIELD, $locale), WorkflowStage::TEST);
     $node->setProperty($this->propertyEncoder->localizedSystemName(self::PUBLISHED_FIELD, $locale), null);
 }
コード例 #2
0
ファイル: StructureSubscriber.php プロジェクト: sulu/sulu
 /**
  * Deindexes the document from the search index for the website.
  *
  * @param UnpublishEvent $event
  */
 public function deindexUnpublishedDocument(UnpublishEvent $event)
 {
     $document = $event->getDocument();
     if (!$document instanceof StructureBehavior) {
         return;
     }
     $this->searchManager->deindex($document);
 }
コード例 #3
0
ファイル: InvalidationSubscriber.php プロジェクト: sulu/sulu
 /**
  * Invalidates the assigned structure and all urls in the locale of the document when a document gets unpublished.
  * This method is executed before the actual unpublishing of the document because the document must still
  * be published to gather the urls of the document.
  *
  * @param UnpublishEvent $event
  */
 public function invalidateDocumentBeforeUnpublishing(UnpublishEvent $event)
 {
     $document = $event->getDocument();
     if ($document instanceof StructureBehavior) {
         $this->invalidateDocumentStructure($document);
     }
     if ($document instanceof ResourceSegmentBehavior && $document instanceof WorkflowStageBehavior && $document->getPublished()) {
         $this->invalidateDocumentUrls($document, $this->documentInspector->getLocale($document));
     }
 }
コード例 #4
0
ファイル: PublishSubscriber.php プロジェクト: sulu/sulu
 /**
  * Sets the node from the live workspace on the given event.
  *
  * @param PublishEvent|UnpublishEvent $event
  */
 private function setNodeFromPublicWorkspace($event)
 {
     $event->setNode($this->getLiveNode($event->getDocument()));
 }