Prado\Data\SqlMap\Statements\TMappedStatement::runQueryForObject PHP Method

runQueryForObject() public method

This method should only be called by internal developers, consider using executeQueryForObject() first.
See also: executeQueryForObject()
public runQueryForObject ( $connection, $command, &$result ) : object
return object the object.
    public function runQueryForObject($connection, $command, &$result)
    {
        $object = null;
        $connection->setActive(true);
        foreach ($command->query() as $row) {
            $object = $this->applyResultMap($row, $result);
        }
        if (!$this->_groupBy->isEmpty()) {
            $list = $this->_groupBy->collect();
            $this->initialGroupByResults();
            $object = $list[0];
        }
        $this->executePostSelect($connection);
        $this->onExecuteQuery($command);
        return $object;
    }