function CreatedItem::applyDefaultValue
Overrides Map::applyDefaultValue
File
-
core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ CreatedItem.php, line 34
Class
- CreatedItem
- Defines the 'created' entity field type.
Namespace
Drupal\Core\Field\Plugin\Field\FieldTypeCode
public function applyDefaultValue($notify = TRUE) {
parent::applyDefaultValue($notify);
// Created fields default to the current timestamp.
$this->setValue([
'value' => \Drupal::time()->getRequestTime(),
], $notify);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.