Prado\Data\TDbCommand::queryRow PHP Метод

queryRow() публичный Метод

This is a convenient method of {@link query} when only the first row of data is needed.
public queryRow ( $fetchAssociative = true ) : array
Результат array the first row of the query result, false if no result.
    public function queryRow($fetchAssociative = true)
    {
        try {
            // Prado::trace('Query Row: '.$this->getDebugStatementText(), 'Prado\Data');
            if ($this->_statement instanceof PDOStatement) {
                $this->_statement->execute();
            } else {
                $this->_statement = $this->getConnection()->getPdoInstance()->query($this->getText());
            }
            $result = $this->_statement->fetch($fetchAssociative ? PDO::FETCH_ASSOC : PDO::FETCH_NUM);
            $this->_statement->closeCursor();
            return $result;
        } catch (Exception $e) {
            throw new TDbException('dbcommand_query_failed', $e->getMessage(), $this->getDebugStatementText());
        }
    }