function ContentEntityForm::updateChangedTime

Updates the changed time of the entity.

Applies only if the entity implements the EntityChangedInterface.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity updated with the submitted values.

1 call to ContentEntityForm::updateChangedTime()
ContentEntityForm::submitForm in core/lib/Drupal/Core/Entity/ContentEntityForm.php

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 398

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

public function updateChangedTime(EntityInterface $entity) {
  if ($entity instanceof EntityChangedInterface) {
    $entity->setChangedTime($this->time
      ->getRequestTime());
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.