public function ColorItem::setName in Color API 8
Set the human-readable 'name' proprty of the Color Field item.
Parameters
string $name: The human-readable name of the color. Example "Red" or "Blue".
bool $notify: Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.
Overrides ColorItemInterface::setName
1 call to ColorItem::setName()
- ColorItem::setValue in src/
Plugin/ Field/ FieldType/ ColorItem.php - Sets the data value.
File
- src/
Plugin/ Field/ FieldType/ ColorItem.php, line 98
Class
- ColorItem
- Provides the Color field.
Namespace
Drupal\colorapi\Plugin\Field\FieldTypeCode
public function setName($name, $notify = TRUE) {
$this
->get('name')
->setValue($name, $notify);
}