public mapToObjects ( array $objectsData ) : array | ||
$objectsData | array | |
리턴 | array |
public function mapToObjects(array $objectsData)
{
$objects = [];
foreach ($objectsData as $objectData) {
$objects[] = $this->mapToObject($objectData);
}
return $objects;
}
/** * Returns the first object in the result set, if any. * * @return mixed The first object of the result set or NULL if the result set was empty * @api */ public function getFirst() { if (is_array($this->queryResult)) { $queryResult =& $this->queryResult; } else { $query = clone $this->query; $query->setLimit(1); $queryResult = $this->dataMapper->mapToObjects($this->persistenceManager->getObjectDataByQuery($query)); } return isset($queryResult[0]) ? $queryResult[0] : null; }