You are here

public function PageVariant::setPageEntity in Page Manager 8

Same name and namespace in other branches
  1. 8.4 src/Entity/PageVariant.php \Drupal\page_manager\Entity\PageVariant::setPageEntity()

Sets the page with a full entity object.

This is mainly useful for setting an unsaved page on a page variant so you can continue to work with it prior to saving.

Parameters

\Drupal\page_manager\PageInterface $page: The page entity object this variant is associated with.

Return value

$this

Overrides PageVariantInterface::setPageEntity

File

src/Entity/PageVariant.php, line 273
Contains Drupal\page_manager\Entity\PageVariant.

Class

PageVariant
Defines the page variant entity.

Namespace

Drupal\page_manager\Entity

Code

public function setPageEntity(PageInterface $page) {
  $this->pageEntity = $page;
  $this->page = $page
    ->id();
  return $this;
}