function PrimitiveBase::setValue

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

Overrides TypedData::setValue

1 method overrides PrimitiveBase::setValue()
BinaryData::setValue in core/lib/Drupal/Core/TypedData/Plugin/DataType/BinaryData.php
Overrides TypedData::setValue().

File

core/lib/Drupal/Core/TypedData/PrimitiveBase.php, line 27

Class

PrimitiveBase
Base class for primitive data types.

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.