Commit 4d23c7bb authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #373 from javer/hhvm-pdo-implement-interfaces

HHVM compatibility: implement declared interfaces
parents f1970d63 e76001cb
......@@ -41,4 +41,51 @@ class PDOConnection extends PDO implements Connection
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('Doctrine\DBAL\Driver\PDOStatement', array()));
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
/**
* {@inheritdoc}
*/
public function prepare($prepareString, $driverOptions = array())
{
return parent::prepare($prepareString, $driverOptions);
}
/**
* {@inheritdoc}
*/
public function query()
{
$args = func_get_args();
$argsCount = count($args);
if ($argsCount == 4) {
return parent::query($args[0], $args[1], $args[2], $args[3]);
}
if ($argsCount == 3) {
return parent::query($args[0], $args[1], $args[2]);
}
if ($argsCount == 2) {
return parent::query($args[0], $args[1]);
}
return parent::query($args[0]);
}
/**
* {@inheritdoc}
*/
public function quote($input, $type = \PDO::PARAM_STR)
{
return parent::quote($input, $type);
}
/**
* {@inheritdoc}
*/
public function lastInsertId($name = null)
{
return parent::lastInsertId($name);
}
}
......@@ -28,9 +28,9 @@ namespace Doctrine\DBAL\Driver;
class PDOStatement extends \PDOStatement implements Statement
{
/**
* Private constructor.
* Protected constructor.
*/
private function __construct()
protected function __construct()
{
}
......@@ -53,4 +53,76 @@ class PDOStatement extends \PDOStatement implements Statement
return parent::setFetchMode($fetchMode, $arg2, $arg3);
}
/**
* {@inheritdoc}
*/
public function bindValue($param, $value, $type = \PDO::PARAM_STR)
{
return parent::bindValue($param, $value, $type);
}
/**
* {@inheritdoc}
*/
public function bindParam($column, &$variable, $type = \PDO::PARAM_STR, $length = null, $driverOptions = array())
{
return parent::bindParam($column, $variable, $type, $length, $driverOptions);
}
/**
* {@inheritdoc}
*/
public function execute($params = null)
{
return parent::execute($params);
}
/**
* {@inheritdoc}
*/
public function fetch($fetchMode = null, $cursorOrientation = null, $cursorOffset = null)
{
if ($fetchMode === null && $cursorOrientation === null && $cursorOffset === null) {
return parent::fetch();
}
if ($cursorOrientation === null && $cursorOffset === null) {
return parent::fetch($fetchMode);
}
if ($cursorOffset === null) {
return parent::fetch($fetchMode, $cursorOrientation);
}
return parent::fetch($fetchMode, $cursorOrientation, $cursorOffset);
}
/**
* {@inheritdoc}
*/
public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null)
{
if ($fetchMode === null && $fetchArgument === null && $ctorArgs === null) {
return parent::fetchAll();
}
if ($fetchArgument === null && $ctorArgs === null) {
return parent::fetchAll($fetchMode);
}
if ($ctorArgs === null) {
return parent::fetchAll($fetchMode, $fetchArgument);
}
return parent::fetchAll($fetchMode, $fetchArgument, $ctorArgs);
}
/**
* {@inheritdoc}
*/
public function fetchColumn($columnIndex = 0)
{
return parent::fetchColumn($columnIndex);
}
}
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