You are here

protected function OpignoModuleListBuilder::getEntities in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/OpignoModuleListBuilder.php \Drupal\opigno_module\OpignoModuleListBuilder::getEntities()

Returns module list.

2 calls to OpignoModuleListBuilder::getEntities()
OpignoModuleListBuilder::getEntityIds in src/OpignoModuleListBuilder.php
Loads entity IDs using a pager sorted by the entity id.
OpignoModuleListBuilder::getTotalCount in src/OpignoModuleListBuilder.php
Returns modules count.

File

src/OpignoModuleListBuilder.php, line 21

Class

OpignoModuleListBuilder
Defines a class to build a listing of Module entities.

Namespace

Drupal\opigno_module

Code

protected function getEntities() {
  $query = $this
    ->getStorage()
    ->getQuery()
    ->sort($this->entityType
    ->getKey('id'));
  $ids = $query
    ->execute();

  // Filter entities that user has edit access.
  $entities = OpignoModule::loadMultiple($ids);
  $entities = array_filter($entities, function ($entity) {
    return $entity
      ->access('update');
  });
  return $entities;
}