TypedDataInterface::getName

public TypedDataInterface::getName() Returns the name of a property or item. Return value string If the data is a property of some complex data, the name of the property. If the data is an item of a list, the name is the numeric position of the item in the list, starting with 0. Otherwise, NULL is returned. File core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 113 Class TypedDataInterface Interface for typed data objects. Namespace Drupal\Core\TypedData Code public function

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

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

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

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