Return the enabled shadow locales for the given document.
public getShadowLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array | ||
$document | Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior | |
return | array |
/** * Adds the enabled shadow languages to the serialization. * * @param ObjectEvent $event */ public function onPostSerialize(ObjectEvent $event) { $document = $event->getObject(); if (!$document instanceof ShadowLocaleBehavior || !$this->documentRegistry->hasDocument($document)) { return; } $visitor = $event->getVisitor(); $visitor->addData('enabledShadowLanguages', $this->documentInspector->getShadowLocales($document)); }
public function getEnabledShadowLanguages() { return $this->inspector->getShadowLocales($this->getDocument()); }