Prado\Data\TDbCommand::query PHP Method

query() public method

This method is for executing an SQL query that returns result set.
public query ( ) : TDbDataReader
return TDbDataReader the reader object for fetching the query result
    public function query()
    {
        try {
            // Prado::trace('Query: '.$this->getDebugStatementText(), 'Prado\Data');
            if ($this->_statement instanceof PDOStatement) {
                $this->_statement->execute();
            } else {
                $this->_statement = $this->getConnection()->getPdoInstance()->query($this->getText());
            }
            return new TDbDataReader($this);
        } catch (Exception $e) {
            throw new TDbException('dbcommand_query_failed', $e->getMessage(), $this->getDebugStatementText());
        }
    }