Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
5da7198b
Commit
5da7198b
authored
Sep 16, 2013
by
javer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compatibility with PHP PDO
parent
7aa02d0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
12 deletions
+48
-12
PDOConnection.php
lib/Doctrine/DBAL/Driver/PDOConnection.php
+17
-5
PDOStatement.php
lib/Doctrine/DBAL/Driver/PDOStatement.php
+31
-7
No files found.
lib/Doctrine/DBAL/Driver/PDOConnection.php
View file @
5da7198b
...
...
@@ -45,9 +45,9 @@ class PDOConnection extends PDO implements Connection
/**
* {@inheritdoc}
*/
public
function
prepare
(
$prepareString
)
public
function
prepare
(
$prepareString
,
$driverOptions
=
array
()
)
{
return
parent
::
prepare
(
$prepareString
);
return
parent
::
prepare
(
$prepareString
,
$driverOptions
);
}
/**
...
...
@@ -56,15 +56,27 @@ class PDOConnection extends PDO implements Connection
public
function
query
()
{
$args
=
func_get_args
();
$
sql
=
$args
[
0
]
;
$
argsCount
=
count
(
$args
)
;
return
parent
::
query
(
$sql
);
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
)
public
function
quote
(
$input
,
$type
=
\PDO
::
PARAM_STR
)
{
return
parent
::
quote
(
$input
,
$type
);
}
...
...
lib/Doctrine/DBAL/Driver/PDOStatement.php
View file @
5da7198b
...
...
@@ -57,7 +57,7 @@ class PDOStatement extends \PDOStatement implements Statement
/**
* {@inheritdoc}
*/
public
function
bindValue
(
$param
,
$value
,
$type
=
null
)
public
function
bindValue
(
$param
,
$value
,
$type
=
\PDO
::
PARAM_STR
)
{
return
parent
::
bindValue
(
$param
,
$value
,
$type
);
}
...
...
@@ -65,9 +65,9 @@ class PDOStatement extends \PDOStatement implements Statement
/**
* {@inheritdoc}
*/
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
null
,
$length
=
null
)
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
\PDO
::
PARAM_STR
,
$length
=
null
,
$driverOptions
=
array
()
)
{
return
parent
::
bindParam
(
$column
,
$variable
,
$type
,
$length
);
return
parent
::
bindParam
(
$column
,
$variable
,
$type
,
$length
,
$driverOptions
);
}
/**
...
...
@@ -81,19 +81,43 @@ class PDOStatement extends \PDOStatement implements Statement
/**
* {@inheritdoc}
*/
public
function
fetch
(
$fetchMode
=
null
)
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
)
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}
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment