3 namespace Drupal\Core\Field\Plugin\Field\FieldType;
6 * Defines the 'created' entity field type.
10 * label = @Translation("Created"),
11 * description = @Translation("An entity field containing a UNIX timestamp of when the entity has been created."),
13 * default_widget = "datetime_timestamp",
14 * default_formatter = "timestamp"
17 class CreatedItem extends TimestampItem {
22 public function applyDefaultValue($notify = TRUE) {
23 parent::applyDefaultValue($notify);
24 // Created fields default to the current timestamp.
25 $this->setValue(['value' => REQUEST_TIME], $notify);