W3cubDocs

/Drupal 8

public function TypedDataInterface::setContext

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

File

core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 159

Class

TypedDataInterface
Interface for typed data objects.

Namespace

Drupal\Core\TypedData

Code

public function setContext($name = NULL, TraversableTypedDataInterface $parent = NULL);

© 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!TypedDataInterface.php/function/TypedDataInterface::setContext/8.1.x