Implements \Drupal\Core\Entity\Field\FieldItemInterface::__set().
Overrides FieldItemInterface::__set
public function __set($name, $value) {
// Support setting values via property objects, but take care in as the
// value of the 'entity' property is typed data also.
if ($value instanceof TypedDataInterface && !$value instanceof EntityInterface) {
$value = $value
->getValue();
}
$this
->set($name, $value);
}