src/Sulu/Bundle/HttpCacheBundle/EventSubscriber/InvalidationSubscriber.php
public function invalidateDocumentBeforeRemoving(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if ($document instanceof StructureBehavior) {
            $this->invalidateDocumentStructure($document);
        }

        if ($document instanceof ResourceSegmentBehavior) {
            foreach ($this->documentInspector->getPublishedLocales($document) as $locale) {
                $this->invalidateDocumentUrls($document, $locale);
            }
        }
    }
public function invalidateDocumentBeforeRemoving(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if ($document instanceof StructureBehavior) {
            $this->invalidateDocumentStructure($document);
        }

        if ($document instanceof ResourceSegmentBehavior) {
            foreach ($this->documentInspector->getPublishedLocales($document) as $locale) {
                $this->invalidateDocumentUrls($document, $locale);
            }
        }
    }
public function invalidateDocumentBeforeRemoving ( RemoveEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( $ document instanceof StructureBehavior ) { $ this -> invalidateDocumentStructure ( $ document ) ; } if ( $ document instanceof ResourceSegmentBehavior ) { foreach ( $ this -> documentInspector -> getPublishedLocales ( $ document ) as $ locale ) { $ this -> invalidateDocumentUrls ( $ document , $ locale ) ; } } }
Invalidates the assigned structure and all urls in all locales of the document when a document gets removed.
This method is executed before the actual removing of the document because the document must still
exist to gather the urls of the document.

@param RemoveEvent $event
Invalidates the assigned structure and all urls in all locales of the document when a document gets removed . This method is executed before the actual removing of the document because the document must still exist to gather the urls of the document .