public function getArrayResult(Database_QueryResult $oQResult) { if ($oQResult->isError()) { return $oQResult; } if (!is_resource($oQResult->rResource)) { return $oQResult->error('database.incorrect_resource'); // TODO uzupelnic string table } $aResult = array(); while ($aRow = mysql_fetch_array($oQResult->rResource, MYSQL_ASSOC)) { $aResult[] = $aRow; } return $oQResult->result($aResult); }
public function query(Database_Query $oQuery) { $this->iQueryCount++; $this->oLastQueryResult = $this->oDriver->query($oQuery); $this->aQueryHistory[] = $this->oLastQueryResult->sql(); if ($this->oLastQueryResult->isError()) { return false; } else { if ($oQuery->returnResult()) { return $this->oDriver->getArrayResult($this->oLastQueryResult)->result(); } else { return true; } } }