You are here

public function BulkFormEntityListBuilder::render in Entity API 8

Builds the entity listing as renderable array for table.html.twig.

@todo Add a link to add a new item to the #empty text.

Overrides EntityListBuilder::render

File

src/BulkFormEntityListBuilder.php, line 98

Class

BulkFormEntityListBuilder
Provides a list builder that allows using bulk actions.

Namespace

Drupal\entity

Code

public function render() {

  // Filter the actions to only include those for this entity type.
  $entity_type_id = $this->entityTypeId;
  $this->actions = array_filter($this->actionStorage
    ->loadMultiple(), function (ActionConfigEntityInterface $action) use ($entity_type_id) {
    return $action
      ->getType() == $entity_type_id;
  });
  $this->entities = $this
    ->load();
  if ($this->entities) {
    return $this->formBuilder
      ->getForm($this);
  }
  return parent::render();
}