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
5c80649f
Commit
5c80649f
authored
Oct 01, 2016
by
Javier Spagnoletti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update statement for some drivers
parent
003f1e23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
+17
-15
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+6
-6
ResultStatement.php
lib/Doctrine/DBAL/Driver/ResultStatement.php
+1
-1
SQLAnywhereStatement.php
...Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
+2
-2
SQLSrvStatement.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
+8
-6
No files found.
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
5c80649f
...
...
@@ -26,7 +26,7 @@ class DB2Statement implements \IteratorAggregate, Statement
/**
* @var resource
*/
private
$_stmt
=
null
;
private
$_stmt
;
/**
* @var array
...
...
@@ -147,8 +147,8 @@ class DB2Statement implements \IteratorAggregate, Statement
public
function
errorInfo
()
{
return
array
(
0
=>
db2_stmt_errormsg
(),
1
=>
db2_stmt_error
(),
db2_stmt_errormsg
(),
db2_stmt_error
(),
);
}
...
...
@@ -207,7 +207,7 @@ class DB2Statement implements \IteratorAggregate, Statement
/**
* {@inheritdoc}
*/
public
function
fetch
(
$fetchMode
=
null
)
public
function
fetch
(
$fetchMode
=
null
,
$cursorOrientation
=
\PDO
::
FETCH_ORI_NEXT
,
$cursorOffset
=
0
)
{
// do not try fetching from the statement if it's not expected to contain result
// in order to prevent exceptional situation
...
...
@@ -243,14 +243,14 @@ class DB2Statement implements \IteratorAggregate, Statement
case
\PDO
::
FETCH_OBJ
:
return
db2_fetch_object
(
$this
->
_stmt
);
default
:
throw
new
DB2Exception
(
"Given Fetch-Style "
.
$fetchMode
.
" is not supported."
);
throw
new
DB2Exception
(
'Given Fetch-Style '
.
$fetchMode
.
' is not supported.'
);
}
}
/**
* {@inheritdoc}
*/
public
function
fetchAll
(
$fetchMode
=
null
)
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
{
$rows
=
array
();
...
...
lib/Doctrine/DBAL/Driver/ResultStatement.php
View file @
5c80649f
...
...
@@ -58,7 +58,7 @@ interface ResultStatement extends \Traversable
/**
* Returns the next row of a result set.
*
*
* @param int|null $fetchMode
Controls how the next row will be returned to the caller.
*
@param int|null $fetchMode
Controls how the next row will be returned to the caller.
* The value must be one of the \PDO::FETCH_* constants,
* defaulting to \PDO::FETCH_BOTH.
* @param int $cursorOrientation For a ResultStatement object representing a scrollable cursor,
...
...
lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
View file @
5c80649f
...
...
@@ -193,7 +193,7 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement
*
* @throws SQLAnywhereException
*/
public
function
fetch
(
$fetchMode
=
null
)
public
function
fetch
(
$fetchMode
=
null
,
$cursorOrientation
=
\PDO
::
FETCH_ORI_NEXT
,
$cursorOffset
=
0
)
{
if
(
!
is_resource
(
$this
->
result
))
{
return
false
;
...
...
@@ -235,7 +235,7 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement
/**
* {@inheritdoc}
*/
public
function
fetchAll
(
$fetchMode
=
null
)
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
{
$rows
=
array
();
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
View file @
5c80649f
...
...
@@ -257,7 +257,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
$params
=
array
();
foreach
(
$this
->
variables
as
$column
=>
&
$variable
)
{
if
(
$this
->
types
[
$column
]
===
\PDO
::
PARAM_LOB
)
{
if
(
PDO
::
PARAM_LOB
===
$this
->
types
[
$column
]
)
{
$params
[
$column
-
1
]
=
array
(
&
$variable
,
SQLSRV_PARAM_IN
,
...
...
@@ -302,8 +302,10 @@ class SQLSrvStatement implements IteratorAggregate, Statement
/**
* {@inheritdoc}
*
* @throws SQLSrvException
*/
public
function
fetch
(
$fetchMode
=
null
)
public
function
fetch
(
$fetchMode
=
null
,
$cursorOrientation
=
PDO
::
FETCH_ORI_NEXT
,
$cursorOffset
=
0
)
{
// do not try fetching from the statement if it's not expected to contain result
// in order to prevent exceptional situation
...
...
@@ -318,25 +320,25 @@ class SQLSrvStatement implements IteratorAggregate, Statement
return
sqlsrv_fetch_array
(
$this
->
stmt
,
self
::
$fetchMap
[
$fetchMode
])
?:
false
;
}
if
(
$fetchMode
==
PDO
::
FETCH_OBJ
||
$fetchMode
==
PDO
::
FETCH_CLASS
)
{
if
(
in_array
(
$fetchMode
,
array
(
PDO
::
FETCH_OBJ
,
PDO
::
FETCH_CLASS
),
true
)
)
{
$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
();
}
return
sqlsrv_fetch_object
(
$this
->
stmt
,
$className
,
$ctorArgs
)
?:
false
;
}
throw
new
SQLSrvException
(
"Fetch mode is not supported!"
);
throw
new
SQLSrvException
(
'Fetch mode is not supported!'
);
}
/**
* {@inheritdoc}
*/
public
function
fetchAll
(
$fetchMode
=
null
)
public
function
fetchAll
(
$fetchMode
=
null
,
$fetchArgument
=
null
,
$ctorArgs
=
null
)
{
$rows
=
array
();
...
...
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