ContextDefinition::$entityContextDefinition

An EntityContextDefinition instance, for backwards compatibility.

If this context is created with a data type that starts with 'entity:', this property will be an instance of EntityContextDefinition, and certain methods of this object will delegate to their overridden counterparts in $this->entityContextDefinition.

This property should be kept private so that it is only accessible to this class for backwards compatibility reasons. It will be removed in Drupal 9.

Type: \Drupal\Core\Plugin\Context\EntityContextDefinition

Deprecated

Constructing a context definition for an entity type (i.e., the data type begins with 'entity:') is deprecated in Drupal 8.6.0. Instead, use the static factory methods of EntityContextDefinition to create context definitions for entity types, or the static ::create() method of this class for any other data type. See https://www.drupal.org/node/2976400 for more information.

See also

::__construct()

::__sleep()

::__wakeup()

::getConstraintObjects()

::getSampleValues()

::initializeEntityContextDefinition()

https://www.drupal.org/node/2932462

https://www.drupal.org/node/2976400

File

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

Class

ContextDefinition
Defines a class for context definitions.

Namespace

Drupal\Core\Plugin\Context

Code

private $entityContextDefinition;

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