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

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

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

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