TypedDataInterface::getConstraints

public TypedDataInterface::getConstraints() Gets a list of validation constraints. Return value array Array of constraints, each being an instance of \Symfony\Component\Validator\Constraint. File core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 81 Class TypedDataInterface Interface for typed data objects. Namespace Drupal\Core\TypedData Code public function getConstraints();

TypedDataInterface::createInstance

public static TypedDataInterface::createInstance($definition, $name = NULL, TraversableTypedDataInterface $parent = NULL) Constructs a TypedData object given its definition and context. @todo When \Drupal\Core\Config\TypedConfigManager has been fixed to use class-based definitions, type-hint $definition to DataDefinitionInterface. https://www.drupal.org/node/1928868 Parameters \Drupal\Core\TypedData\DataDefinitionInterface $definition: The data definition. string|null $name: (optional) The nam

TypedDataInterface::applyDefaultValue

public TypedDataInterface::applyDefaultValue($notify = TRUE) Applies the default value. Parameters bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again. Return value \Drupal\Core\TypedData\TypedDataInterface Returns itself to allow for chaining. File core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 103 Class TypedDataInterface Interface for type

TypedDataInterface

Interface for typed data objects. Hierarchy interface \Drupal\Core\TypedData\TypedDataInterface See also \Drupal\Core\TypedData\DataDefinitionInterface Related topics Typed Data API API for describing data based on a set of available data types. File core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 12 Namespace Drupal\Core\TypedData Members Name Modifiers Type Description TypedDataInterface::applyDefaultValue public function Applies the default value. Typ

TypedData::__sleep

public TypedData::__sleep() File core/lib/Drupal/Core/TypedData/TypedData.php, line 201 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code public function __sleep() { $vars = get_object_vars($this); // Prevent services from being serialized. static::getStringTranslation() // and static::getTypedDataManager() lazy-load them after $this has been // unserialized. // @todo Replace this with // \Drupal\Core\DependencyInjection\Dependen

TypedData::__construct

public TypedData::__construct($definition, $name = NULL, TypedDataInterface $parent = NULL) Constructs a TypedData object given its definition and context. @todo When \Drupal\Core\Config\TypedConfigManager has been fixed to use class-based definitions, type-hint $definition to DataDefinitionInterface. https://www.drupal.org/node/1928868 Parameters \Drupal\Core\TypedData\DataDefinitionInterface $definition: The data definition. string $name: (optional) The name of the created property, or NULL

TypedData::validate

public TypedData::validate() Validates the currently set data value. Return value \Symfony\Component\Validator\ConstraintViolationListInterface A list of constraint violations. If the list is empty, validation succeeded. Overrides TypedDataInterface::validate File core/lib/Drupal/Core/TypedData/TypedData.php, line 134 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code public function validate() { return $this->getTypedDataManager()->ge

TypedData::setValue

public TypedData::setValue($value, $notify = TRUE) Sets the data value. Parameters mixed|null $value: The value to set in the format as documented for the data type or NULL to unset the data value. bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again. Throws \InvalidArgumentException If the value input is inappropriate. \Drupal\Core\TypedData\Exception\ReadOnly

TypedData::setContext

public TypedData::setContext($name = NULL, TraversableTypedDataInterface $parent = NULL) Sets the context of a property or item via a context aware parent. This method is supposed to be called by the factory only. Parameters string|null $name: (optional) The name of the property or the delta of the list item, or NULL if it is the root of a typed data tree. Defaults to NULL. \Drupal\Core\TypedData\TraversableTypedDataInterface|null $parent: (optional) The parent object of the data property, or

TypedData::getValue

public TypedData::getValue() Gets the data value. Return value mixed Overrides TypedDataInterface::getValue File core/lib/Drupal/Core/TypedData/TypedData.php, line 97 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code public function getValue() { return $this->value; }