use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
-use Drupal\Core\Routing\RedirectDestinationTrait;
/**
* Defines a class to build a listing of custom block entities.
*/
class BlockContentListBuilder extends EntityListBuilder {
- use RedirectDestinationTrait;
-
/**
* {@inheritdoc}
*/
/**
* {@inheritdoc}
*/
- public function getDefaultOperations(EntityInterface $entity) {
- $operations = parent::getDefaultOperations($entity);
- if (isset($operations['edit'])) {
- $operations['edit']['query']['destination'] = $this->getRedirectDestination()->get();
+ protected function getEntityIds() {
+ $query = $this->getStorage()->getQuery()
+ ->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 $operations;
+ return $query->execute();
}
}