function DateTimeItem::onChange

Same name and namespace in other branches
  1. 8.9.x core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::onChange()
  2. 10 core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::onChange()
  3. 11.x core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::onChange()

Overrides Map::onChange

1 call to DateTimeItem::onChange()
DateRangeItem::onChange in core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php
React to changes to a child property or item.
1 method overrides DateTimeItem::onChange()
DateRangeItem::onChange in core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php
React to changes to a child property or item.

File

core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php, line 132

Class

DateTimeItem
Plugin implementation of the 'datetime' field type.

Namespace

Drupal\datetime\Plugin\Field\FieldType

Code

public function onChange($property_name, $notify = TRUE) {
    // Enforce that the computed date is recalculated.
    if ($property_name == 'value') {
        $this->date = NULL;
    }
    parent::onChange($property_name, $notify);
}

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