Commit d3930dcd authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DBAL-214'

parents 200c4df1 484e1c30
......@@ -47,8 +47,12 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
return $this->columnCount;
}
public function setFetchMode($fetchStyle)
public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)
{
if ($arg2 !== null || $arg3 !== null) {
throw new \InvalidArgumentException("Caching layer does not support 2nd/3rd argument to setFetchMode()");
}
$this->defaultFetchStyle = $fetchStyle;
}
......@@ -95,4 +99,4 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
}
return $row[$columnIndex];
}
}
\ No newline at end of file
}
......@@ -132,7 +132,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
return $this->statement->columnCount();
}
public function setFetchMode($fetchStyle)
public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)
{
$this->defaultFetchStyle = $fetchStyle;
}
......
......@@ -190,7 +190,7 @@ class OCI8Statement implements \IteratorAggregate, Statement
/**
* {@inheritdoc}
*/
public function setFetchMode($fetchStyle = PDO::FETCH_BOTH)
public function setFetchMode($fetchStyle = PDO::FETCH_BOTH, $arg2 = null, $arg3 = null)
{
$this->_defaultFetchStyle = $fetchStyle;
}
......
......@@ -31,12 +31,20 @@ class PDOStatement extends \PDOStatement implements Statement
{
private function __construct() {}
public function setFetchMode($fetchStyle, $params = NULL)
public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)
{
// This thin wrapper is necessary to shield against the weird signature
// of PDOStatement::setFetchMode(): even if the second and third
// parameters are optional, PHP will not let us remove it from this
// declaration.
return parent::setFetchMode($fetchStyle);
if ($arg2 === null || $arg3 === null) {
return parent::setFetchMode($fetchStyle);
}
if ($arg3 === null) {
return parent::setFetchMode($fetchStyle, $arg2);
}
return parent::setFetchMode($fetchStyle, $arg2, $arg3);
}
}
\ No newline at end of file
}
......@@ -52,7 +52,7 @@ interface ResultStatement extends \Traversable
*
* @param integer $fetchStyle
*/
public function setFetchMode($fetchStyle);
function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null);
/**
* fetch
......
......@@ -101,9 +101,10 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
return $this->stmt->execute($params);
}
public function setFetchMode($fetchStyle)
public function setFetchMode($fetchStyle, $arg1 = null, $arg2 = null)
{
$this->defaultFetchStyle = $fetchStyle;
$this->stmt->setFetchMode($fetchStyle, $arg1, $arg2);
}
public function getIterator()
......
......@@ -184,9 +184,9 @@ class Statement implements \IteratorAggregate, DriverStatement
return $this->stmt->errorInfo();
}
public function setFetchMode($fetchStyle)
public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)
{
return $this->stmt->setFetchMode($fetchStyle);
return $this->stmt->setFetchMode($fetchStyle, $arg2, $arg3);
}
public function getIterator()
......@@ -251,4 +251,4 @@ class Statement implements \IteratorAggregate, DriverStatement
{
return $this->stmt;
}
}
\ No newline at end of file
}
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