public function ConfigPagesStorage::loadMultiple in Config Pages 8.2
Same name and namespace in other branches
- 8.3 src/ConfigPagesStorage.php \Drupal\config_pages\ConfigPagesStorage::loadMultiple()
Loads one or more entities.
Parameters
$ids: An array of entity IDs, or NULL to load all entities.
Return value
\Drupal\Core\Entity\EntityInterface[] An array of entity objects indexed by their IDs. Returns an empty array if no matching entities are found.
Overrides EntityStorageBase::loadMultiple
File
- src/
ConfigPagesStorage.php, line 37
Class
- ConfigPagesStorage
- Defines the storage handler class for ConfigPages.
Namespace
Drupal\config_pagesCode
public function loadMultiple(array $ids = NULL) {
$entities = [];
// Return all entities if $ids is NULL.
if (empty($ids)) {
return parent::loadMultiple();
}
// Use module load method to get ConfigPage loaded by id.
foreach ($ids as $id) {
$entity = $this
->load($id);
if (!empty($entity)) {
$entities[$entity
->id()] = $entity;
}
}
return $entities;
}