public FieldItemBase::setValue($values, $notify = TRUE)
Overrides \Drupal\Core\TypedData\TypedData::setValue().
array|null $values: An array of property values.
Overrides Map::setValue
public function setValue($values, $notify = TRUE) { // Treat the values as property value of the first property, if no array is // given. if (isset($values) && !is_array($values)) { $keys = array_keys($this->definition->getPropertyDefinitions()); $values = array($keys[0] => $values); } parent::setValue($values, $notify); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Field!FieldItemBase.php/function/FieldItemBase::setValue/8.1.x