TypedDataManagerInterface::getValidator

public TypedDataManagerInterface::getValidator() Gets the validator for validating typed data. Return value \Symfony\Component\Validator\Validator\ValidatorInterface The validator object. File core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php, line 171 Class TypedDataManagerInterface Defines an interface for typed data manager. Namespace Drupal\Core\TypedData Code public function getValidator();

TypedDataManagerInterface::getValidationConstraintManager

public TypedDataManagerInterface::getValidationConstraintManager() Gets the validation constraint manager. Return value \Drupal\Core\Validation\ConstraintManager The constraint manager. File core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php, line 187 Class TypedDataManagerInterface Defines an interface for typed data manager. Namespace Drupal\Core\TypedData Code public function getValidationConstraintManager();

TypedDataManagerInterface::getPropertyInstance

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

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.

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