function FieldItemBase::writePropertyValue
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Field/FieldItemBase.php \Drupal\Core\Field\FieldItemBase::writePropertyValue()
Different to the parent Map class, we avoid creating property objects as far as possible in order to optimize performance. Thus we just update $this->values if no property object has been created yet.
File
-
core/
lib/ Drupal/ Core/ Field/ FieldItemBase.php, line 121
Class
- FieldItemBase
- An entity field item.
Namespace
Drupal\Core\FieldCode
protected function writePropertyValue($property_name, $value) {
// For defined properties there is either a property object or a plain
// value that needs to be updated.
if (isset($this->properties[$property_name])) {
$this->properties[$property_name]
->setValue($value, FALSE);
}
else {
$this->values[$property_name] = $value;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.