You are here

public function DateRecurItem::setValue in Recurring Dates Field 3.0.x

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

Overrides \Drupal\Core\TypedData\TypedData::setValue().

Parameters

array|null $values: An array of property values.

bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.

Overrides FieldItemBase::setValue

File

src/Plugin/Field/FieldType/DateRecurItem.php, line 376

Class

DateRecurItem
Plugin implementation of the 'date_recur' field type.

Namespace

Drupal\date_recur\Plugin\Field\FieldType

Code

public function setValue($values, $notify = TRUE) : void {

  // Cast infinite to boolean on load.
  $values['infinite'] = !empty($values['infinite']);

  // All values are going to be overwritten atomically.
  $this
    ->resetHelper();
  parent::setValue($values, $notify);
}