function ContentEntityForm::updateChangedTime

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::updateChangedTime()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::updateChangedTime()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\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
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form stateā€¦

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.