TypedData

The abstract base class for typed data. Classes deriving from this base class have to declare $value or override getValue() or setValue(). Hierarchy class \Drupal\Core\TypedData\TypedData implements PluginInspectionInterface, TypedDataInterface uses StringTranslationTrait, TypedDataTrait Related topics Typed Data API API for describing data based on a set of available data types. File core/lib/Drupal/Core/TypedData/TypedData.php, line 16 Namespace Drupal\Core\TypedData Members Name

TypedData::$definition

The data definition. Type: \Drupal\Core\TypedData\DataDefinitionInterface File core/lib/Drupal/Core/TypedData/TypedData.php, line 26 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code protected $definition;

TypedData::$name

The property name. Type: string File core/lib/Drupal/Core/TypedData/TypedData.php, line 33 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code protected $name;

TypedData::$parent

The parent typed data object. Type: \Drupal\Core\TypedData\TraversableTypedDataInterface|null File core/lib/Drupal/Core/TypedData/TypedData.php, line 40 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code protected $parent;

TypedData::applyDefaultValue

public TypedData::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. Overrides TypedDataInterface::applyDefaultValue File core/lib/Drupal/Core/TypedData/TypedData.php, line 141 Class TypedDat

TypedData::createInstance

public static TypedData::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 name of the

TypedData::getConstraints

public TypedData::getConstraints() Gets a list of validation constraints. Return value array Array of constraints, each being an instance of \Symfony\Component\Validator\Constraint. Overrides TypedDataInterface::getConstraints File core/lib/Drupal/Core/TypedData/TypedData.php, line 122 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code public function getConstraints() { $constraint_manager = $this->getTypedDataManager()->getValidationC

TypedData::getDataDefinition

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

TypedData::getName

public TypedData::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. Overrides TypedDataInterface::getName File core/lib/Drupal/Core/TypedData/TypedData.php, line 158 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Cod

TypedData::getParent

public TypedData::getParent() Returns the parent data structure; i.e. either complex data or a list. Return value \Drupal\Core\TypedData\TraversableTypedDataInterface|null The parent data structure, either complex data or a list; or NULL if this is the root of the typed data tree. Overrides TypedDataInterface::getParent File core/lib/Drupal/Core/TypedData/TypedData.php, line 194 Class TypedData The abstract base class for typed data. Namespace Drupal\Core\TypedData Code public functio