function TypedData::setValue

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::setValue()
  2. 8.9.x core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::setValue()
  3. 10 core/lib/Drupal/Core/TypedData/TypedData.php \Drupal\Core\TypedData\TypedData::setValue()

Overrides TypedDataInterface::setValue

2 calls to TypedData::setValue()
SectionData::setValue in core/modules/layout_builder/src/Plugin/DataType/SectionData.php
Sets the data value.
TypedData::applyDefaultValue in core/lib/Drupal/Core/TypedData/TypedData.php
Applies the default value.
10 methods override TypedData::setValue()
ComputedFileUrl::setValue in core/modules/file/src/ComputedFileUrl.php
Sets the data value.
DataReferenceBase::setValue in core/lib/Drupal/Core/TypedData/DataReferenceBase.php
Sets the data value.
DateTimeComputed::setValue in core/modules/datetime/src/DateTimeComputed.php
Sets the data value.
EntityAdapter::setValue in core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
Sets the data value.
ItemList::setValue in core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php
Overrides \Drupal\Core\TypedData\TypedData::setValue().

... See full list

File

core/lib/Drupal/Core/TypedData/TypedData.php, line 101

Class

TypedData
The abstract base class for typed data.

Namespace

Drupal\Core\TypedData

Code

public function setValue($value, $notify = TRUE) {
    $this->value = $value;
    // Notify the parent of any changes.
    if ($notify && isset($this->parent)) {
        $this->parent
            ->onChange($this->name);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.