Prado\Data\SqlMap\Statements\TMappedStatement::runQueryForList PHP Méthode

runQueryForList() public méthode

This method should only be called by internal developers, consider using executeQueryForList() first.
See also: executeQueryForList()
public runQueryForList ( $connection, $parameter, $sql, $result, $delegate = null ) : array
Résultat array a list of result objects
    public function runQueryForList($connection, $parameter, $sql, $result, $delegate = null)
    {
        $registry = $this->getManager()->getTypeHandlers();
        $list = $result instanceof \ArrayAccess ? $result : $this->_statement->createInstanceOfListClass($registry);
        $connection->setActive(true);
        $reader = $sql->query();
        //$reader = $this->executeSQLQueryLimit($connection, $sql, $max, $skip);
        if ($delegate !== null) {
            foreach ($reader as $row) {
                $obj = $this->applyResultMap($row);
                $param = new TResultSetListItemParameter($obj, $parameter, $list);
                $this->raiseRowDelegate($delegate, $param);
            }
        } else {
            //var_dump($sql,$parameter);
            foreach ($reader as $row) {
                //				var_dump($row);
                $list[] = $this->applyResultMap($row);
            }
        }
        if (!$this->_groupBy->isEmpty()) {
            $list = $this->_groupBy->collect();
            $this->initialGroupByResults();
        }
        $this->executePostSelect($connection);
        $this->onExecuteQuery($sql);
        return $list;
    }