You are here

public function PageVariant::addSelectionCondition in Page Manager 8

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

Adds selection criteria.

Parameters

array $configuration: Configuration of the selection criteria.

Return value

string The condition ID of the new criteria.

Overrides PageVariantInterface::addSelectionCondition

File

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

Class

PageVariant
Defines the page variant entity.

Namespace

Drupal\page_manager\Entity

Code

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