You are here

public function ContentEntityForm::updateChangedTime in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 289
Contains \Drupal\Core\Entity\ContentEntityForm.

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

public function updateChangedTime(EntityInterface $entity) {
  if ($entity
    ->getEntityType()
    ->isSubclassOf(EntityChangedInterface::class)) {
    $entity
      ->setChangedTime(REQUEST_TIME);
  }
}