Implements the magic method for setting object properties.
Uses default language always.
public function __set($name, $value) {
// Support setting values via property objects.
if ($value instanceof TypedDataInterface && !$value instanceof EntityInterface) {
$value = $value
->getValue();
}
// If this is an entity field, handle it accordingly. We first check whether
// a field object has been already created. If not, we create one.
if (isset($this->fields[$name][Language::LANGCODE_DEFAULT])) {
$this->fields[$name][Language::LANGCODE_DEFAULT]
->setValue($value);
}
elseif ($this
->getPropertyDefinition($name)) {
$this
->getTranslatedField($name, Language::LANGCODE_DEFAULT)
->setValue($value);
}
else {
$this->values[$name] = $value;
}
}