EntityDataDefinition::getBundles

public EntityDataDefinition::getBundles() Gets the array of possible entity bundles. Return value array|null The array of possible bundles, or NULL for any. Overrides EntityDataDefinitionInterface::getBundles File core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 116 Class EntityDataDefinition A typed data definition class for describing entities. Namespace Drupal\Core\Entity\TypedData Code public function getBundles() { $bundle = isset($this->definition['const

EntityDataDefinition::createFromDataType

public static EntityDataDefinition::createFromDataType($data_type) Creates a new data definition object. This method is typically used by \Drupal\Core\TypedData\TypedDataManager::createDataDefinition() to build a definition object for an arbitrary data type. When the definition class is known, it is recommended to directly use the static create() method on that class instead; e.g.: $map_definition = \Drupal\Core\TypedData\MapDataDefinition::create(); Parameters string $data_type: The data t

EntityDataDefinition::create

public static EntityDataDefinition::create($entity_type_id = NULL) Creates a new entity definition. Parameters string $entity_type_id: (optional) The ID of the entity type, or NULL if the entity type is unknown. Defaults to NULL. Return value static Overrides DataDefinition::create File core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 21 Class EntityDataDefinition A typed data definition class for describing entities. Namespace Drupal\Core\Entity\TypedData Code pu

EntityDataDefinition

A typed data definition class for describing entities. Hierarchy class \Drupal\Core\TypedData\DataDefinition implements \ArrayAccess, DataDefinitionInterfaceclass \Drupal\Core\TypedData\ComplexDataDefinitionBase implements ComplexDataDefinitionInterfaceclass \Drupal\Core\Entity\TypedData\EntityDataDefinition implements EntityDataDefinitionInterface File core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 10 Namespace Drupal\Core\Entity\TypedData Members Name Modif

EntityConverter::__construct

public EntityConverter::__construct(EntityManagerInterface $entity_manager) Constructs a new EntityConverter. Parameters \Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager. File core/lib/Drupal/Core/ParamConverter/EntityConverter.php, line 54 Class EntityConverter Parameter converter for upcasting entity IDs to full objects. Namespace Drupal\Core\ParamConverter Code public function __construct(EntityManagerInterface $entity_manager) { $this->entityMana

EntityConverter::getEntityTypeFromDefaults

protected EntityConverter::getEntityTypeFromDefaults($definition, $name, array $defaults) Determines the entity type ID given a route definition and route defaults. Parameters mixed $definition: The parameter definition provided in the route options. string $name: The name of the parameter. array $defaults: The route defaults array. Return value string The entity type ID. Throws \Drupal\Core\ParamConverter\ParamNotConvertedException Thrown when the dynamic entity type is not found in the rou

EntityConverter::convert

public EntityConverter::convert($value, $definition, $name, array $defaults) Converts path variables to their corresponding objects. Parameters mixed $value: The raw value. mixed $definition: The parameter definition provided in the route options. string $name: The name of the parameter. array $defaults: The route defaults array. Return value mixed|null The converted parameter value. Overrides ParamConverterInterface::convert File core/lib/Drupal/Core/ParamConverter/EntityConverter.php, line

EntityConverter::applies

public EntityConverter::applies($definition, $name, Route $route) Determines if the converter applies to a specific route and variable. Parameters mixed $definition: The parameter definition provided in the route options. string $name: The name of the parameter. \Symfony\Component\Routing\Route $route: The route to consider attaching to. Return value bool TRUE if the converter applies to the passed route and parameter, FALSE otherwise. Overrides ParamConverterInterface::applies File core/lib/

EntityConverter::$entityManager

Entity manager which performs the upcasting in the end. Type: \Drupal\Core\Entity\EntityManagerInterface File core/lib/Drupal/Core/ParamConverter/EntityConverter.php, line 46 Class EntityConverter Parameter converter for upcasting entity IDs to full objects. Namespace Drupal\Core\ParamConverter Code protected $entityManager;

EntityConverter

Parameter converter for upcasting entity IDs to full objects. This is useful in cases where the dynamic elements of the path can't be auto-determined; for example, if your path refers to multiple of the same type of entity ("example/{node1}/foo/{node2}") or if the path can act on any entity type ("example/{entity_type}/{entity}/foo"). In order to use it you should specify some additional options in your route: example.route: path: foo/{example} options: parameters: example: