EntityTestListBuilder.php
Same filename and directory in other branches
- 11.x core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php
- 10 core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php
- 9 core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php
- 8.9.x core/modules/system/tests/modules/entity_test/src/EntityTestListBuilder.php
Namespace
Drupal\entity_testFile
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ EntityTestListBuilder.php
View source
<?php
declare (strict_types=1);
namespace Drupal\entity_test;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
/**
* Defines a class to build a listing of entity test entities.
*
* @see \Drupal\entity_test\Entity\EntityTest
*/
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);
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| EntityTestListBuilder | Defines a class to build a listing of entity test entities. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.