function ContextDefinition::getSampleValues

Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::getSampleValues()
  2. 8.9.x core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::getSampleValues()
  3. 10 core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::getSampleValues()

Returns typed data objects representing this context definition.

This should return as many objects as needed to reflect the variations of the constraints it supports.

@yield \Drupal\Core\TypedData\TypedDataInterface The set of typed data object.

1 method overrides ContextDefinition::getSampleValues()
EntityContextDefinition::getSampleValues in core/lib/Drupal/Core/Plugin/Context/EntityContextDefinition.php
Returns typed data objects representing this context definition.

File

core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php, line 347

Class

ContextDefinition
Defines a class for context definitions.

Namespace

Drupal\Core\Plugin\Context

Code

protected function getSampleValues() {
    (yield $this->getTypedDataManager()
        ->create($this->getDataDefinition()));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.