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 if it is the root of a typed data tree. Defaults to NULL.

\Drupal\Core\TypedData\TypedDataInterface $parent: (optional) The parent object of the data property, or NULL if it is the root of a typed data tree. Defaults to NULL.

See also

\Drupal\Core\TypedData\TypedDataManager::create()

File

core/lib/Drupal/Core/TypedData/TypedData.php, line 67

Class

TypedData
The abstract base class for typed data.

Namespace

Drupal\Core\TypedData

Code

public function __construct($definition, $name = NULL, TypedDataInterface $parent = NULL) {
  $this->definition = $definition;
  $this->parent = $parent;
  $this->name = $name;
}
doc_Drupal
2016-10-29 09:50:02
Comments
Leave a Comment

Please login to continue.