W3cubDocs

/Drupal 8

public function TypedDataInterface::setValue

public TypedDataInterface::setValue($value, $notify = TRUE)

Sets the data value.

Parameters

mixed|null $value: The value to set in the format as documented for the data type or NULL to unset the data value.

bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.

Throws

\InvalidArgumentException If the value input is inappropriate.

\Drupal\Core\TypedData\Exception\ReadOnlyException If the data is read-only.

File

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

Class

TypedDataInterface
Interface for typed data objects.

Namespace

Drupal\Core\TypedData

Code

public function setValue($value, $notify = TRUE);

© 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::setValue/8.1.x