Commit 857b9500 authored by Steve Müller's avatar Steve Müller

fix CS

parent cc1aeec9
......@@ -236,23 +236,23 @@ class SQLSrvStatement implements IteratorAggregate, Statement
*/
public function fetch($fetchMode = null)
{
$args = func_get_args();
$args = func_get_args();
$fetchMode = $fetchMode ?: $this->defaultFetchMode;
if (isset(self::$fetchMap[$fetchMode])) {
$rows = sqlsrv_fetch_array($this->stmt, self::$fetchMap[$fetchMode]);
return sqlsrv_fetch_array($this->stmt, self::$fetchMap[$fetchMode]) ?: false;
}
return $rows ?: false;
} elseif ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
$className = $this->defaultFetchClass;
$ctorArgs = $this->defaultFetchClassCtorArgs;
if (count($args) >= 2) {
$className = $args[1];
$ctorArgs = (isset($args[2])) ? $args[2] : array();
$ctorArgs = (isset($args[2])) ? $args[2] : array();
}
$rows = sqlsrv_fetch_object($this->stmt, $className, $ctorArgs);
return $rows ?: false;
return sqlsrv_fetch_object($this->stmt, $className, $ctorArgs) ?: false;
}
throw new SQLSrvException("Fetch mode is not supported!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment