$this->
updateChangedTime($this->entity
);
} /**
* {@inheritdoc}
*/
public function buildEntity(array
$form, FormStateInterface
$form_state) { /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = parent::
buildEntity($form,
$form_state);
// Mark the entity as requiring validation.
$entity->
setValidationRequired(!
$form_state->
getTemporaryValue('entity_validated'
));
// Save as a new revision if requested to do so.
if ($this->
showRevisionUi() && !
$form_state->
isValueEmpty('revision'
)) { $entity->
setNewRevision();
if ($entity instanceof RevisionLogInterface
) { // If a new revision is created, save the current user as
// revision author.
$entity->
setRevisionUserId($this->
currentUser()->
id());
$entity->
setRevisionCreationTime($this->time->
getRequestTime());
} }