function UuidItem::applyDefaultValue
Same name in other branches
- 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php \Drupal\Core\Field\Plugin\Field\FieldType\UuidItem::applyDefaultValue()
- 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php \Drupal\Core\Field\Plugin\Field\FieldType\UuidItem::applyDefaultValue()
- 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php \Drupal\Core\Field\Plugin\Field\FieldType\UuidItem::applyDefaultValue()
Overrides Map::applyDefaultValue
File
-
core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ UuidItem.php, line 36
Class
- UuidItem
- Defines the 'uuid' entity field type.
Namespace
Drupal\Core\Field\Plugin\Field\FieldTypeCode
public function applyDefaultValue($notify = TRUE) {
// Default to one field item with a generated UUID.
$uuid = \Drupal::service('uuid');
$this->setValue([
'value' => $uuid->generate(),
], $notify);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.