diff --git a/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php b/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php index acfad6ab..aacd9801 100644 --- a/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php +++ b/Content/Infrastructure/Sulu/Structure/ContentStructureBridge.php @@ -13,6 +13,7 @@ namespace Sulu\Bundle\ContentBundle\Content\Infrastructure\Sulu\Structure; +use Sulu\Bundle\ContentBundle\Content\Domain\Model\ShadowInterface; use Sulu\Bundle\ContentBundle\Content\Domain\Model\TemplateInterface; use Sulu\Component\Content\Compat\Property; use Sulu\Component\Content\Compat\PropertyInterface; @@ -402,23 +403,35 @@ public function getNavContexts(): array } /** - * @return string[] + * @return array */ public function getShadowLocales(): array { + $content = $this->getContent(); + if ($content instanceof ShadowInterface) { + return $content->getShadowLocales() ?? []; + } + return []; } - /** - * @return mixed|null - */ - public function getShadowBaseLanguage() + public function getShadowBaseLanguage(): ?string { + $content = $this->getContent(); + if ($content instanceof ShadowInterface) { + return $content->getShadowLocale(); + } + return null; } public function getIsShadow(): bool { + $content = $this->getContent(); + if ($content instanceof ShadowInterface) { + return (bool) $content->getShadowLocale(); + } + return false; }