W3cubDocs

/Drupal 8

public function TypedDataManagerInterface::getInstance

public TypedDataManagerInterface::getInstance(array $options)

Parameters

array $options: An array of options with the following keys:

  • object: The parent typed data object, implementing the TypedDataInterface and either the ListInterface or the ComplexDataInterface.
  • property: The name of the property to instantiate, or the delta of the the list item to instantiate.
  • value: The value to set. If set, it has to match one of the supported data type formats as documented by the data type classes.

Return value

\Drupal\Core\TypedData\TypedDataInterface The new property instance.

Throws

\InvalidArgumentException If the given property is not known, or the passed object does not implement the ListInterface or the ComplexDataInterface.

Overrides MapperInterface::getInstance

See also

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

File

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

Class

TypedDataManagerInterface
Defines an interface for typed data manager.

Namespace

Drupal\Core\TypedData

Code

public function getInstance(array $options);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!TypedDataManagerInterface.php/function/TypedDataManagerInterface::getInstance/8.1.x