protected function getFromStorage(array
$ids = NULL
) { $entities =
[];
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);
} }