Commit dcd0bc66 authored by Steve Müller's avatar Steve Müller

fix CS

parent 4d29ad40
...@@ -238,21 +238,21 @@ class SQLSrvStatement implements IteratorAggregate, Statement ...@@ -238,21 +238,21 @@ class SQLSrvStatement implements IteratorAggregate, Statement
{ {
$args = func_get_args(); $args = func_get_args();
$fetchMode = $fetchMode ?: $this->defaultFetchMode; $fetchMode = $fetchMode ?: $this->defaultFetchMode;
if (isset(self::$fetchMap[$fetchMode])) { 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; if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
} elseif ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
$className = $this->defaultFetchClass; $className = $this->defaultFetchClass;
$ctorArgs = $this->defaultFetchClassCtorArgs; $ctorArgs = $this->defaultFetchClassCtorArgs;
if (count($args) >= 2) { if (count($args) >= 2) {
$className = $args[1]; $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 sqlsrv_fetch_object($this->stmt, $className, $ctorArgs) ?: false;
return $rows ?: false;
} }
throw new SQLSrvException("Fetch mode is not supported!"); 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