TypedDataManagerInterface::createInstance

public TypedDataManagerInterface::createInstance($data_type, array $configuration = array())

Instantiates a typed data object.

Parameters

string $data_type: The data type, for which a typed object should be instantiated.

array $configuration: The plugin configuration array, i.e. an array with the following keys:

  • data_definition: The data definition object, i.e. an instance of \Drupal\Core\TypedData\DataDefinitionInterface.
  • name: The name of the property or the delta of the list item if a property or list item is to be created. Otherwise, this should be set to NULL, but the key must be specified.
  • parent: The parent typed data object implementing either the ListInterface or the ComplexDataInterface if a property or list item is to be created. Otherwise, this should be set to NULL, but the key must be specified.

Return value

\Drupal\Core\TypedData\TypedDataInterface The instantiated typed data object.

Overrides FactoryInterface::createInstance

See also

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

File

core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php, line 37

Class

TypedDataManagerInterface
Defines an interface for typed data manager.

Namespace

Drupal\Core\TypedData

Code

public function createInstance($data_type, array $configuration = array());
doc_Drupal
2016-10-29 09:50:11
Comments
Leave a Comment

Please login to continue.