final public Load ( |
||
$Request | The request to load | |
return | The loaded result rows |
public final function Load(Request $Request)
{
$Columns = [];
foreach ($Request->GetTables() as $Table) {
$this->VerifyTable(__METHOD__, $Table);
$Columns += $Table->GetColumnsByIdentifier();
}
$ResultRowData = $this->LoadResultRowData($Request);
$ResultRow = new ResultRow($Columns, []);
return array_map([$ResultRow, 'Another'], $ResultRowData);
}
/** * Loads all entities that are specified from the given request instance. * * @param Object\IRequest $ObjectRequest The request to load * @return array|object|null Depending on the supplied request, either all the entities are * returned as an array or the first is returned or null if none are found. */ public final function Load(Object\IRequest $ObjectRequest) { $EntityType = $ObjectRequest->GetEntityType(); $this->VerifyEntityTypeIsMapped($EntityType); $RelationalRequest = $this->MapRequest($ObjectRequest); $ResultRows = $this->Database->Load($RelationalRequest); $RevivalDataArray = $this->MapRowsToRevivalData($EntityType, $ResultRows); $RevivedEntities = $this->Domain->ReviveEntities($EntityType, $RevivalDataArray); if ($ObjectRequest->IsSingleEntity()) { return count($RevivedEntities) > 0 ? reset($RevivedEntities) : null; } else { return $RevivedEntities; } }