TypedDataManager::createDataDefinition

public TypedDataManager::createDataDefinition($data_type) Creates a new data definition object. While data definitions objects may be created directly if the definition class used by a data type is known, this method allows the creation of data definitions for any given data type. For example, if a definition for a map is to be created, the following code could be used instead of calling this method with the argument 'map': $map_definition = \Drupal\Core\TypedData\MapDataDefinition::create();

TypedDataManager::createInstance

public TypedDataManager::createInstance($data_type, array $configuration = array()) Creates a pre-configured instance of a plugin. Parameters string $plugin_id: The ID of the plugin being instantiated. array $configuration: An array of configuration relevant to the plugin instance. Return value object A fully configured plugin instance. Throws \Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid. Overrides PluginManagerBase::creat

TypedDataManager::createListDataDefinition

public TypedDataManager::createListDataDefinition($item_type) Creates a new list data definition for items of the given data type. Parameters string $item_type: The item type, for which a list data definition should be created. Return value \Drupal\Core\TypedData\ListDataDefinitionInterface A list definition for items of the given data type. Overrides TypedDataManagerInterface::createListDataDefinition See also \Drupal\Core\TypedData\TypedDataManager::createDataDefinition() File core/lib/Dru

TypedDataManager::getCanonicalRepresentation

public TypedDataManager::getCanonicalRepresentation(TypedDataInterface $data) Gets the canonical representation of a TypedData object. The canonical representation is typically used when data is passed on to other code components. In many use cases, the TypedData object is mostly unified adapter wrapping a primary value (a string, an entity, etc.) which is the canonical representation that consuming code like constraint validators are really interested in. For some APIs, though, the domain obje

TypedDataManager::getDefaultConstraints

public TypedDataManager::getDefaultConstraints(DataDefinitionInterface $definition) Gets default constraints for the given data definition. This generates default constraint definitions based on the data definition; for example, a NotNull constraint is generated if the data is defined as required. Besides that, any constraints defined for the data type (that is, below the 'constraint' key of the type's plugin definition) are taken into account. Parameters \Drupal\Core\TypedData\DataDefinitionI

TypedDataManager::getInstance

public TypedDataManager::getInstance(array $options) Gets a preconfigured instance of a plugin. Parameters array $options: An array of options that can be used to determine a suitable plugin to instantiate and how to configure it. Return value object|false A fully configured plugin instance. The interface of the plugin instance will depends on the plugin type. If no instance can be retrieved, FALSE will be returned. Overrides PluginManagerBase::getInstance File core/lib/Drupal/Core/TypedData/

TypedDataManager::getPropertyInstance

public TypedDataManager::getPropertyInstance(TypedDataInterface $object, $property_name, $value = NULL) Get a typed data instance for a property of a given typed data object. This method will use prototyping for fast and efficient instantiation of many property objects with the same property path; for example, when multiple comments are used comment_body.0.value needs to be instantiated very often. Prototyping is done by the root object's data type and the given property path, i.e. all property

TypedDataManager::getValidationConstraintManager

public TypedDataManager::getValidationConstraintManager() Gets the validation constraint manager. Return value \Drupal\Core\Validation\ConstraintManager The constraint manager. Overrides TypedDataManagerInterface::getValidationConstraintManager File core/lib/Drupal/Core/TypedData/TypedDataManager.php, line 234 Class TypedDataManager Manages data type plugins. Namespace Drupal\Core\TypedData Code public function getValidationConstraintManager() { return $this->constraintManager; }

TypedDataManager::getValidator

public TypedDataManager::getValidator() Gets the validator for validating typed data. Return value \Symfony\Component\Validator\Validator\ValidatorInterface The validator object. Overrides TypedDataManagerInterface::getValidator File core/lib/Drupal/Core/TypedData/TypedDataManager.php, line 213 Class TypedDataManager Manages data type plugins. Namespace Drupal\Core\TypedData Code public function getValidator() { if (!isset($this->validator)) { $this->validator = new Recurs

TypedDataManager::setValidationConstraintManager

public TypedDataManager::setValidationConstraintManager(ConstraintManager $constraintManager) Sets the validation constraint manager. The validation constraint manager is used to instantiate validation constraint plugins. Parameters \Drupal\Core\Validation\ConstraintManager $constraintManager: The constraint manager to set. Overrides TypedDataManagerInterface::setValidationConstraintManager File core/lib/Drupal/Core/TypedData/TypedDataManager.php, line 227 Class TypedDataManager Manages d