TypedDataManager::setValidator

public TypedDataManager::setValidator(ValidatorInterface $validator) Sets the validator for validating typed data. Parameters \Symfony\Component\Validator\Validator\ValidatorInterface $validator: The validator object to set. Overrides TypedDataManagerInterface::setValidator File core/lib/Drupal/Core/TypedData/TypedDataManager.php, line 206 Class TypedDataManager Manages data type plugins. Namespace Drupal\Core\TypedData Code public function setValidator(ValidatorInterface $validator)

TypedDataManager::__construct

public TypedDataManager::__construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ClassResolverInterface $class_resolver) Constructs a new TypedDataManager. Parameters \Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations. \Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use. \Drupal\Core\Ex

TypedDataManagerInterface

Defines an interface for typed data manager. Hierarchy interface \Drupal\Component\Plugin\PluginManagerInterface; interface \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterfaceinterface \Drupal\Core\TypedData\TypedDataManagerInterface File core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php, line 13 Namespace Drupal\Core\TypedData Members Name Modifiers Type Description CachedDiscoveryInterface::clearCachedDefinitions public function Clears static and pe

TypedDataManagerInterface::create

public TypedDataManagerInterface::create(DataDefinitionInterface $definition, $value = NULL, $name = NULL, $parent = NULL) Creates a new typed data object instance. Parameters \Drupal\Core\TypedData\DataDefinitionInterface $definition: The data definition of the typed data object. For backwards-compatibility an array representation of the data definition may be passed also. mixed $value: (optional) The data value. If set, it has to match one of the supported data type format as documented for

TypedDataManagerInterface::createDataDefinition

public TypedDataManagerInterface::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::

TypedDataManagerInterface::createInstance

public TypedDataManagerInterface::createInstance($data_type, array $configuration = array()) Instantiates a typed data object. Parameters string $data_type: The data type, for which a typed object should be instantiated. array $configuration: The plugin configuration array, i.e. an array with the following keys: data_definition: The data definition object, i.e. an instance of \Drupal\Core\TypedData\DataDefinitionInterface. name: The name of the property or the delta of the list item if a pro

TypedDataManagerInterface::createListDataDefinition

public TypedDataManagerInterface::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. See also \Drupal\Core\TypedData\TypedDataManager::createDataDefinition() File core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php, lin

TypedDataManagerInterface::getCanonicalRepresentation

public TypedDataManagerInterface::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 do

TypedDataManagerInterface::getDefaultConstraints

public TypedDataManagerInterface::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\DataDe

TypedDataManagerInterface::getInstance

public TypedDataManagerInterface::getInstance(array $options) Parameters array $options: An array of options with the following keys: object: The parent typed data object, implementing the TypedDataInterface and either the ListInterface or the ComplexDataInterface. property: The name of the property to instantiate, or the delta of the the list item to instantiate. value: The value to set. If set, it has to match one of the supported data type formats as documented by the data type classes.