public function PageVariant::getPage in Page Manager 8
Same name and namespace in other branches
- 8.4 src/Entity/PageVariant.php \Drupal\page_manager\Entity\PageVariant::getPage()
Gets the page this variant is on.
Return value
\Drupal\page_manager\PageInterface
Overrides PageVariantInterface::getPage
File
- src/
Entity/ PageVariant.php, line 256 - Contains Drupal\page_manager\Entity\PageVariant.
Class
- PageVariant
- Defines the page variant entity.
Namespace
Drupal\page_manager\EntityCode
public function getPage() {
if (!$this->pageEntity) {
if (!$this->page) {
throw new \UnexpectedValueException('The page variant has no associated page');
}
$this->pageEntity = $this
->getPageStorage()
->load($this->page);
if (!$this->pageEntity) {
throw new \UnexpectedValueException(sprintf('The page %s could not be loaded', $this->page));
}
}
return $this->pageEntity;
}