Gdn_DataSet::_fetchAllRows PHP Method

_fetchAllRows() protected method

Fetches all rows from the PDOStatement object into the resultset.
protected _fetchAllRows ( string $DatasetType = false )
$DatasetType string The format in which the result should be returned: object or array. It will fill a different array depending on which type is specified.
    protected function _fetchAllRows($DatasetType = false)
    {
        if (!is_null($this->_Result)) {
            return;
        }
        if ($DatasetType) {
            $this->_DatasetType = $DatasetType;
        }
        $Result = array();
        if (is_null($this->_PDOStatement)) {
            $this->_Result = $Result;
            return;
        }
        $Result = $this->_PDOStatement->fetchAll($this->_DatasetType == DATASET_TYPE_ARRAY ? PDO::FETCH_ASSOC : PDO::FETCH_OBJ);
        //		$this->_PDOStatement->setFetchMode($this->_DatasetType == DATASET_TYPE_ARRAY ? PDO::FETCH_ASSOC : PDO::FETCH_OBJ);
        //      while($Row = $this->_PDOStatement->fetch()) {
        //			$Result[] = $Row;
        //		}
        $this->freePDOStatement(true);
        $this->_Result = $Result;
    }