You are here

public function Page::addAccessCondition in Page Manager 8.4

Same name and namespace in other branches
  1. 8 src/Entity/Page.php \Drupal\page_manager\Entity\Page::addAccessCondition()

Adds a new access condition to the page entity.

Parameters

array $configuration: An array of configuration for the new access condition.

Return value

string The access condition ID.

Overrides PageInterface::addAccessCondition

File

src/Entity/Page.php, line 207

Class

Page
Defines a Page entity class.

Namespace

Drupal\page_manager\Entity

Code

public function addAccessCondition(array $configuration) {
  $configuration['uuid'] = $this
    ->uuidGenerator()
    ->generate();
  $this
    ->getAccessConditions()
    ->addInstanceId($configuration['uuid'], $configuration);
  return $configuration['uuid'];
}