You are here

public function ChartConfigItem::setValue in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x src/Plugin/Field/FieldType/ChartConfigItem.php \Drupal\charts\Plugin\Field\FieldType\ChartConfigItem::setValue()

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

Parameters

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

Overrides FieldItemBase::setValue

File

src/Plugin/Field/FieldType/ChartConfigItem.php, line 85

Class

ChartConfigItem
Plugin implementation of the 'chart_config' field type.

Namespace

Drupal\charts\Plugin\Field\FieldType

Code

public function setValue($values, $notify = TRUE) {
  if (isset($values) && isset($values['config'])) {
    $values['library'] = $values['config']['library'];
    $values['type'] = $values['config']['type'];
  }
  parent::setValue($values, $notify);
}