src/Sulu/Bundle/PageBundle/Search/EventSubscriber/StructureSubscriber.php
public function deindexRemovedDocument(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$document instanceof StructureBehavior) {
            return;
        }

        if (!$document instanceof WorkflowStageBehavior) {
            $this->searchManager->deindex($document);
        } else {
            $workflowStage = $document->getWorkflowStage();

            foreach (WorkflowStage::$stages as $stage) {
                $document->setWorkflowStage($stage);
                $this->searchManager->deindex($document);
            }

            $document->setWorkflowStage($workflowStage);
        }
    }
public function deindexRemovedDocument(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$document instanceof StructureBehavior) {
            return;
        }

        if (!$document instanceof WorkflowStageBehavior) {
            $this->searchManager->deindex($document);
        } else {
            $workflowStage = $document->getWorkflowStage();

            foreach (WorkflowStage::$stages as $stage) {
                $document->setWorkflowStage($stage);
                $this->searchManager->deindex($document);
            }

            $document->setWorkflowStage($workflowStage);
        }
    }
public function deindexRemovedDocument ( RemoveEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof StructureBehavior ) { return ; } if ( ! $ document instanceof WorkflowStageBehavior ) { $ this -> searchManager -> deindex ( $ document ) ; } else { $ workflowStage = $ document -> getWorkflowStage ( ) ; foreach ( WorkflowStage :: $ stages as $ stage ) { $ document -> setWorkflowStage ( $ stage ) ; $ this -> searchManager -> deindex ( $ document ) ; } $ document -> setWorkflowStage ( $ workflowStage ) ; } }
Schedules a document to be deindexed.

@param RemoveEvent $event
Schedules a document to be deindexed .