protected SqlContentEntityStorage::getFromStorage(array $ids = NULL)
Gets entities from the storage.
array|null $ids: If not empty, return entities that match these IDs. Return all entities when NULL.
\Drupal\Core\Entity\ContentEntityInterface[] Array of entities from the storage.
protected function getFromStorage(array $ids = NULL) { $entities = array(); if (!empty($ids)) { // Sanitize IDs. Before feeding ID array into buildQuery, check whether // it is empty as this would load all entities. $ids = $this->cleanIds($ids); } if ($ids === NULL || $ids) { // Build and execute the query. $query_result = $this->buildQuery($ids)->execute(); $records = $query_result->fetchAllAssoc($this->idKey); // Map the loaded records into entity objects and according fields. if ($records) { $entities = $this->mapFromStorageRecords($records); } } return $entities; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Sql!SqlContentEntityStorage.php/function/SqlContentEntityStorage::getFromStorage/8.1.x