vendor/sulu/sulu/src/Sulu/Component/Content/Compat/Structure/PageBridge.php line 16

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Component\Content\Compat\Structure;
  11. use Sulu\Component\Content\Compat\PageInterface;
  12. class PageBridge extends StructureBridge implements PageInterface
  13. {
  14.     public function getView()
  15.     {
  16.         return $this->structure->getView();
  17.     }
  18.     public function getController()
  19.     {
  20.         return $this->structure->getController();
  21.     }
  22.     public function getUrls()
  23.     {
  24.         return $this->inspector->getLocalizedUrlsForPage($this->getDocument());
  25.     }
  26.     public function getLanguageCode()
  27.     {
  28.         if (!$this->document) {
  29.             return $this->locale;
  30.         }
  31.         // return original locale for shadow or ghost pages
  32.         if ($this->getIsShadow() || ($this->getType() && 'ghost' === $this->getType()->getName())) {
  33.             return $this->inspector->getOriginalLocale($this->getDocument());
  34.         }
  35.         return parent::getLanguageCode();
  36.     }
  37.     public function getCacheLifeTime()
  38.     {
  39.         return $this->structure->getCacheLifetime();
  40.     }
  41.     public function getOriginTemplate()
  42.     {
  43.         return $this->structure->getName();
  44.     }
  45.     public function setOriginTemplate($originTemplate)
  46.     {
  47.         $this->readOnlyException(__METHOD__);
  48.     }
  49.     public function getNavContexts()
  50.     {
  51.         return $this->document->getNavigationContexts();
  52.     }
  53.     public function setNavContexts($navContexts)
  54.     {
  55.         $this->readOnlyException(__METHOD__);
  56.     }
  57.     public function getInternalLinkContent()
  58.     {
  59.         $target $this->getDocument()->getRedirectTarget();
  60.         if (!$target) {
  61.             throw new \RuntimeException(\sprintf(
  62.                 'No redirect target set on document at path "%s" with redirect type "%s"',
  63.                 $this->inspector->getPath($this->document),
  64.                 $this->document->getRedirectType()
  65.             ));
  66.         }
  67.         return $this->documentToStructure($target);
  68.     }
  69.     public function setInternalLinkContent($internalLinkContent)
  70.     {
  71.         $this->readOnlyException(__METHOD__);
  72.     }
  73.     public function setInternal($internal)
  74.     {
  75.         $this->readOnlyException(__METHOD__);
  76.     }
  77.     public function setNodeState($state)
  78.     {
  79.         $this->readOnlyException(__METHOD__);
  80.     }
  81. }