3 namespace Drupal\entity_browser\Controllers;
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\Core\Entity\EntityListBuilder;
9 * Provides a list controller for entity browser.
11 * @ingroup entity_browser
13 class EntityBrowserListBuilder extends EntityListBuilder {
18 * Building the header and content lines for the entity browser list.
20 * Calling the parent::buildHeader() adds a column for the possible actions
21 * and inserts the 'edit' and 'delete' links as defined for the entity type.
23 public function buildHeader() {
24 $header['id'] = $this->t('ID');
25 $header['name'] = $this->t('Name');
26 return $header + parent::buildHeader();
32 public function buildRow(EntityInterface $entity) {
33 /* @var $entity \Drupal\entity_browser\Entity\EntityBrowser */
34 $row['id'] = $entity->id();
35 $row['name'] = $entity->label();
36 return $row + parent::buildRow($entity);