function EntityContextDefinition::fromEntityType
Same name in other branches
- 9 core/lib/Drupal/Core/Plugin/Context/EntityContextDefinition.php \Drupal\Core\Plugin\Context\EntityContextDefinition::fromEntityType()
- 8.9.x core/lib/Drupal/Core/Plugin/Context/EntityContextDefinition.php \Drupal\Core\Plugin\Context\EntityContextDefinition::fromEntityType()
- 10 core/lib/Drupal/Core/Plugin/Context/EntityContextDefinition.php \Drupal\Core\Plugin\Context\EntityContextDefinition::fromEntityType()
Creates a context definition from a given entity type.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type from which to derive a context definition.
Return value
static
6 calls to EntityContextDefinition::fromEntityType()
- EntityBundle::getDerivativeDefinitions in core/
lib/ Drupal/ Core/ Entity/ Plugin/ Condition/ Deriver/ EntityBundle.php - Gets the definition of all derivatives of a base plugin.
- EntityContext::fromEntityType in core/
lib/ Drupal/ Core/ Plugin/ Context/ EntityContext.php - Gets a context from an entity type.
- EntityContextDefinition::fromEntity in core/
lib/ Drupal/ Core/ Plugin/ Context/ EntityContextDefinition.php - Creates a context definition from a given entity object.
- EntityContextDefinition::fromEntityTypeId in core/
lib/ Drupal/ Core/ Plugin/ Context/ EntityContextDefinition.php - Creates a context definition from a given entity type ID.
- EntityContextDefinitionIsSatisfiedTest::providerTestIsSatisfiedBy in core/
tests/ Drupal/ Tests/ Core/ Plugin/ Context/ EntityContextDefinitionIsSatisfiedTest.php - Provides test data for ::testIsSatisfiedBy().
File
-
core/
lib/ Drupal/ Core/ Plugin/ Context/ EntityContextDefinition.php, line 100
Class
- EntityContextDefinition
- Defines a class to provide entity context definitions.
Namespace
Drupal\Core\Plugin\ContextCode
public static function fromEntityType(EntityTypeInterface $entity_type) {
return new static('entity:' . $entity_type->id(), $entity_type->getLabel());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.