function EntityChangedTrait::getChangedTime

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityChangedTrait.php \Drupal\Core\Entity\EntityChangedTrait::getChangedTime()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityChangedTrait.php \Drupal\Core\Entity\EntityChangedTrait::getChangedTime()
  3. 10 core/lib/Drupal/Core/Entity/EntityChangedTrait.php \Drupal\Core\Entity\EntityChangedTrait::getChangedTime()

Gets the timestamp of the last entity change for the current translation.

Return value

int|null The timestamp of the last entity save operation. Some entities allow a NULL value indicating the changed time is unknown.

File

core/lib/Drupal/Core/Entity/EntityChangedTrait.php, line 33

Class

EntityChangedTrait
Provides a trait for accessing changed time.

Namespace

Drupal\Core\Entity

Code

public function getChangedTime() {
    $value = $this->get('changed')->value;
    return isset($value) ? (int) $value : NULL;
}

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