getPublishedLocales() public method

Return the published locales for the given document.
public getPublishedLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array
$document Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior
return array
Esempio n. 1
0
 /**
  * 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
  */
 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);
         }
     }
 }