function DateTimeComputed::setValue

Same name in other branches
  1. 8.9.x core/modules/datetime/src/DateTimeComputed.php \Drupal\datetime\DateTimeComputed::setValue()
  2. 10 core/modules/datetime/src/DateTimeComputed.php \Drupal\datetime\DateTimeComputed::setValue()
  3. 11.x core/modules/datetime/src/DateTimeComputed.php \Drupal\datetime\DateTimeComputed::setValue()

Overrides TypedData::setValue

File

core/modules/datetime/src/DateTimeComputed.php, line 81

Class

DateTimeComputed
A computed property for dates of date time field items.

Namespace

Drupal\datetime

Code

public function setValue($value, $notify = TRUE) {
    $this->date = $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.