/** * @param int $fetchStyle A constant PDO::FETCH_something * @return array The result set */ public function queryFetchAll($fetchStyle = PDO::FETCH_ASSOC) { $sql = $this->toSQL(); $st = $this->inner->Cn->query($sql); if ($st === false) { if ($this->inner->PDOErrorsToQIErrors) { throw QIError::fromPDO($this->inner->Cn, $sql); } return null; } $rs = $st->fetchAll($fetchStyle); if (isset($this->postProcessing)) { $rs = $this->inner->postProcessRS($rs, $this->postProcessing); } return $rs; }
/** * @param array $boundValues * @param int $fetchStyle * @return array The result set */ public function queryFetchAll(array $boundValues = null, $fetchStyle = PDO::FETCH_ASSOC) { if (!$this->ps) { throw new QIError('Cannot call queryFetchAll before prepare'); } if (isset($boundValues)) { foreach ($boundValues as $parameter => list($val, $pdoParam)) { if (!$this->ps->bindValue($parameter, $val, $pdoParam)) { throw QIError::fromPDO($this->inner->Cn, $this->sql); } } } if (!$this->ps->execute()) { if ($this->inner->PDOErrorsToQIErrors) { throw QIError::fromPDO($this->inner->Cn, $this->sql); } return false; } $rs = $this->ps->fetchAll($fetchStyle); if (isset($this->postProcessing)) { $rs = $this->inner->postProcessRS($rs, $this->postProcessing); } return $rs; }