function taxonomy_test_taxonomy_term_load

Same name in other branches
  1. 7.x modules/simpletest/tests/taxonomy_test.module \taxonomy_test_taxonomy_term_load()
  2. 10 core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module \taxonomy_test_taxonomy_term_load()

Implements hook_ENTITY_TYPE_load() for the taxonomy term.

1 string reference to 'taxonomy_test_taxonomy_term_load'
TaxonomyTermPagerTest::testTaxonomyTermOverviewTermLoad in core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
Tests that overview page only loads the necessary terms.

File

core/modules/taxonomy/tests/modules/taxonomy_test/taxonomy_test.module, line 55

Code

function taxonomy_test_taxonomy_term_load($entities) {
    $value = \Drupal::state()->get(__FUNCTION__);
    // Only record loaded terms is the test has set this to an empty array.
    if (is_array($value)) {
        $value = array_merge($value, array_keys($entities));
        \Drupal::state()->set(__FUNCTION__, array_unique($value));
    }
}

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