class BlockContentListBuilder
Same name and namespace in other branches
- 11.x core/modules/block_content/src/BlockContentListBuilder.php \Drupal\block_content\BlockContentListBuilder
Defines a class to build a listing of custom block entities.
Hierarchy
- class \Drupal\Core\Entity\EntityHandlerBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Entity\EntityListBuilder extends \Drupal\Core\Entity\EntityListBuilderInterface, \Drupal\Core\Entity\EntityHandlerInterface uses \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait implements \Drupal\Core\Entity\EntityHandlerBase
- class \Drupal\block_content\BlockContentListBuilder implements \Drupal\Core\Entity\EntityListBuilder
- class \Drupal\Core\Entity\EntityListBuilder extends \Drupal\Core\Entity\EntityListBuilderInterface, \Drupal\Core\Entity\EntityHandlerInterface uses \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait implements \Drupal\Core\Entity\EntityHandlerBase
Expanded class hierarchy of BlockContentListBuilder
See also
\Drupal\block_content\Entity\BlockContent
File
-
core/
modules/ block_content/ src/ BlockContentListBuilder.php, line 13
Namespace
Drupal\block_contentView source
class BlockContentListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['label'] = $this->t('Block description');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity->label();
return $row + parent::buildRow($entity);
}
/**
* {@inheritdoc}
*/
protected function getEntityIds() {
$query = $this->getStorage()
->getQuery()
->accessCheck(TRUE)
->sort($this->entityType
->getKey('id'));
$query->condition('reusable', TRUE);
// Only add the pager if a limit is specified.
if ($this->limit) {
$query->pager($this->limit);
}
return $query->execute();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.