You are here

public function DateTimeItem::onChange in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::onChange()

Parameters

bool $notify: (optional) Whether to forward the notification to the parent. Defaults to TRUE. By passing FALSE, overrides of this method can re-use the logic of parent classes without triggering notification.

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 131

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);
}