class EntityTestListBuilder

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php \Drupal\entity_test\EntityTestListBuilder
  2. 10 core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php \Drupal\entity_test\EntityTestListBuilder
  3. 9 core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php \Drupal\entity_test\EntityTestListBuilder
  4. 8.9.x core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php \Drupal\entity_test\EntityTestListBuilder

Defines a class to build a listing of entity test entities.

Hierarchy

Expanded class hierarchy of EntityTestListBuilder

See also

\Drupal\entity_test\Entity\EntityTest

3 files declare their use of EntityTestListBuilder
EntityListBuilderTest.php in core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
EntityTest.php in core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php
EntityTestWithBundle.php in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithBundle.php

File

core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php, line 15

Namespace

Drupal\entity_test
View source
class EntityTestListBuilder extends EntityListBuilder {
  
  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this->t('Label');
    $header['id'] = $this->t('Machine name');
    return $header + parent::buildHeader();
  }
  
  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['label'] = $entity->label();
    $row['id'] = $entity->id();
    return $row + parent::buildRow($entity);
  }

}

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