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. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php \Drupal\KernelTests\Core\Entity\ContentEntityChangedTest::getRevisionTranslationAffectedFlag()
  3. 10 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 506

Class

ContentEntityChangedTest
Tests basic EntityChangedInterface functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function getRevisionTranslationAffectedFlag(EntityTestMulRevChanged $entity) : bool {
    $query = $this->mulRevChangedStorage
        ->getQuery()
        ->accessCheck(FALSE);
    $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.