You are here

public function ScheduledChangeItem::setValue in Commerce Recurring Framework 8

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

Parameters

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

Overrides FieldItemBase::setValue

File

src/Plugin/Field/FieldType/ScheduledChangeItem.php, line 79

Class

ScheduledChangeItem
Plugin implementation of the 'commerce_scheduled_change' field type.

Namespace

Drupal\commerce_recurring\Plugin\Field\FieldType

Code

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

  // Allow callers to pass a ScheduledChange value object.
  if ($values instanceof ScheduledChange) {
    $values = [
      'field_name' => $values
        ->getFieldName(),
      'value' => $values
        ->getValue(),
      'created' => $values
        ->getCreatedTime(),
    ];
  }
  parent::setValue($values, $notify);
}