Overrides \Drupal\Core\TypedData\TypedData::setValue().
array|null $values: An array of property values.
Overrides TypedData::setValue
public function setValue($values, $notify = TRUE) {
if (isset($values) && !is_array($values)) {
throw new \InvalidArgumentException("Invalid values given. Values must be represented as an associative array.");
}
// Notify the parent of any changes to be made.
if ($notify && isset($this->parent)) {
$this->parent
->onChange($this->name);
}
$this->values = $values;
// Update any existing property objects.
foreach ($this->properties as $name => $property) {
$value = NULL;
if (isset($values[$name])) {
$value = $values[$name];
}
$property
->setValue($value, FALSE);
}
}