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));
        }
    }