3 namespace Drupal\block_content;
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\Core\Entity\EntityListBuilder;
9 * Defines a class to build a listing of custom block entities.
11 * @see \Drupal\block_content\Entity\BlockContent
13 class BlockContentListBuilder extends EntityListBuilder {
18 public function buildHeader() {
19 $header['label'] = t('Block description');
20 return $header + parent::buildHeader();
26 public function buildRow(EntityInterface $entity) {
27 $row['label'] = $entity->label();
28 return $row + parent::buildRow($entity);
34 protected function getEntityIds() {
35 $query = $this->getStorage()->getQuery()
36 ->sort($this->entityType->getKey('id'));
37 $query->condition('reusable', TRUE);
39 // Only add the pager if a limit is specified.
41 $query->pager($this->limit);
43 return $query->execute();