Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityChangedTrait.php

function EntityChangedTrait::getChangedTimeAcrossTranslations

Returns the timestamp of the last entity change across all translations.

Return value

int The timestamp of the last entity save operation across all translations.

File

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

Class

EntityChangedTrait
Provides a trait for accessing changed time.

Namespace

Drupal\Core\Entity

Code

public function getChangedTimeAcrossTranslations() {
    $changed = $this->getUntranslated()
        ->getChangedTime();
    foreach ($this->getTranslationLanguages(FALSE) as $language) {
        $translation_changed = $this->getTranslation($language->getId())
            ->getChangedTime();
        $changed = max($translation_changed, $changed);
    }
    return $changed;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal