You are here

public function DateRecurFieldItemList::postSave in Recurring Dates Field 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/DateRecurFieldItemList.php \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::postSave()
  2. 3.x src/Plugin/Field/FieldType/DateRecurFieldItemList.php \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::postSave()
  3. 3.0.x src/Plugin/Field/FieldType/DateRecurFieldItemList.php \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::postSave()
  4. 3.1.x src/Plugin/Field/FieldType/DateRecurFieldItemList.php \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::postSave()

Defines custom post-save behavior for field values.

This method is called during the process of saving an entity, just after item values are written into storage.

Parameters

bool $update: Specifies whether the entity is being updated or created.

Return value

bool Whether field items should be rewritten to the storage as a consequence of the logic implemented by the custom behavior.

Overrides FieldItemList::postSave

See also

\Drupal\Core\Field\FieldItemInterface::postSave()

File

src/Plugin/Field/FieldType/DateRecurFieldItemList.php, line 12

Class

DateRecurFieldItemList
Represents a configurable entity date_recur field.

Namespace

Drupal\date_recur\Plugin\Field\FieldType

Code

public function postSave($update) {
  parent::postSave($update);

  /** @var DateRecurItem $item */
  foreach ($this as $field_delta => $item) {
    $item
      ->getOccurrenceHandler()
      ->onSave($update, $field_delta);
  }
  if ($update && isset($field_delta)) {
    $item
      ->getOccurrenceHandler()
      ->onSaveMaxDelta($field_delta);
  }
}