public function TypedDataInterface::setContext

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 $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\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.

4 methods override TypedDataInterface::setContext()
Entity::setContext in drupal/core/lib/Drupal/Core/Entity/Entity.php
Implements \Drupal\Core\TypedData\TypedDataInterface::setContext().
EntityBCDecorator::setContext in drupal/core/lib/Drupal/Core/Entity/EntityBCDecorator.php
Forwards the call to the decorated entity.
TypedData::setContext in drupal/core/lib/Drupal/Core/TypedData/TypedData.php
Implements \Drupal\Core\TypedData\TypedDataInterface::setContext().
ViewUI::setContext in drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
Implements \Drupal\Core\TypedData\TypedDataInterface::setContext().

File

drupal/core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 135
Contains \Drupal\Core\TypedData\TypedDataInterface.

Class

TypedDataInterface
Interface for typed data objects.

Namespace

Drupal\Core\TypedData

Code

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