You are here

public function DateTimeDayItem::onChange in Date time day 8

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 DateTimeItem::onChange

File

src/Plugin/Field/FieldType/DateTimeDayItem.php, line 156

Class

DateTimeDayItem
Plugin implementation of the 'datetimeday' field type.

Namespace

Drupal\date_time_day\Plugin\Field\FieldType

Code

public function onChange($property_name, $notify = TRUE) {

  // Enforce that the computed date is recalculated.
  if ($property_name == 'start_time_value') {
    $this->start_time = NULL;
  }
  elseif ($property_name == 'end_time_value') {
    $this->end_time = NULL;
  }
  parent::onChange($property_name, $notify);
}