src/Sulu/Bundle/HttpCacheBundle/EventSubscriber/InvalidationSubscriber.php
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));
        }
    }
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));
        }
    }
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 ) ) ; } }
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
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 .