function ContentEntityChangedTest::getRevisionTranslationAffectedFlag

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php \Drupal\KernelTests\Core\Entity\ContentEntityChangedTest::getRevisionTranslationAffectedFlag()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php \Drupal\KernelTests\Core\Entity\ContentEntityChangedTest::getRevisionTranslationAffectedFlag()
  3. 11.x core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php \Drupal\KernelTests\Core\Entity\ContentEntityChangedTest::getRevisionTranslationAffectedFlag()

Retrieves the revision translation affected flag value.

Parameters

\Drupal\entity_test\Entity\EntityTestMulRevChanged $entity: The entity object to be checked.

Return value

bool The flag value.

1 call to ContentEntityChangedTest::getRevisionTranslationAffectedFlag()
ContentEntityChangedTest::testRevisionChanged in core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
Tests revisionable EntityChangedInterface functionality.

File

core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php, line 565

Class

ContentEntityChangedTest
Tests basic EntityChangedInterface functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function getRevisionTranslationAffectedFlag(EntityTestMulRevChanged $entity) {
    $query = $this->mulRevChangedStorage
        ->getQuery();
    $ids = $query->condition('revision_translation_affected', 1, '=', $entity->language()
        ->getId())
        ->execute();
    $id = reset($ids);
    return (bool) ($id == $entity->id());
}

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