3 namespace Drupal\block_content;
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\Core\Entity\EntityListBuilder;
7 use Drupal\Core\Routing\RedirectDestinationTrait;
10 * Defines a class to build a listing of custom block entities.
12 * @see \Drupal\block_content\Entity\BlockContent
14 class BlockContentListBuilder extends EntityListBuilder {
16 use RedirectDestinationTrait;
21 public function buildHeader() {
22 $header['label'] = t('Block description');
23 return $header + parent::buildHeader();
29 public function buildRow(EntityInterface $entity) {
30 $row['label'] = $entity->label();
31 return $row + parent::buildRow($entity);
37 public function getDefaultOperations(EntityInterface $entity) {
38 $operations = parent::getDefaultOperations($entity);
39 if (isset($operations['edit'])) {
40 $operations['edit']['query']['destination'] = $this->getRedirectDestination()->get();