You are here

public function SmartDateItem::onChange in Smart Date 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()
  2. 8 src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()
  3. 3.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()
  4. 3.1.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()
  5. 3.2.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()
  6. 3.3.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()
  7. 3.4.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::onChange()

Parameters

$property_name: The name of the property.

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

File

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

Class

SmartDateItem
Plugin implementation of the 'smartdate' field type.

Namespace

Drupal\smart_date\Plugin\Field\FieldType

Code

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

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