protected executePostSelect ( $connection ) |
protected function executePostSelect($connection)
{
while (count($this->_selectQueue)) {
$postSelect = array_shift($this->_selectQueue);
$method = $postSelect->getMethod();
$statement = $postSelect->getStatement();
$property = $postSelect->getResultProperty()->getProperty();
$keys = $postSelect->getKeys();
$resultObject = $postSelect->getResultObject();
if ($method == self::QUERY_FOR_LIST || $method == self::QUERY_FOR_ARRAY) {
$values = $statement->executeQueryForList($connection, $keys, null);
if ($method == self::QUERY_FOR_ARRAY) {
$values = $values->toArray();
}
TPropertyAccess::set($resultObject, $property, $values);
} else {
if ($method == self::QUERY_FOR_OBJECT) {
$value = $statement->executeQueryForObject($connection, $keys, null);
TPropertyAccess::set($resultObject, $property, $value);
}
}
}
}