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
5e8192df
Unverified
Commit
5e8192df
authored
May 29, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make DB2Statement forward-compatible as well
parent
c08d3bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
1 deletion
+53
-1
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+53
-1
No files found.
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
5e8192df
...
...
@@ -2,9 +2,11 @@
namespace
Doctrine\DBAL\Driver\IBMDB2
;
use
Doctrine\DBAL\Driver\FetchUtils
;
use
Doctrine\DBAL\Driver\Statement
;
use
Doctrine\DBAL\Driver\StatementIterator
;
use
Doctrine\DBAL\FetchMode
;
use
Doctrine\DBAL\ForwardCompatibility\Driver\ResultStatement
as
ForwardCompatibleResultStatement
;
use
Doctrine\DBAL\ParameterType
;
use
IteratorAggregate
;
use
PDO
;
...
...
@@ -46,7 +48,7 @@ use const DB2_LONG;
use
const
DB2_PARAM_FILE
;
use
const
DB2_PARAM_IN
;
class
DB2Statement
implements
IteratorAggregate
,
Statement
class
DB2Statement
implements
IteratorAggregate
,
Statement
,
ForwardCompatibleResultStatement
{
/** @var resource */
private
$stmt
;
...
...
@@ -356,6 +358,56 @@ class DB2Statement implements IteratorAggregate, Statement
return
$row
[
$columnIndex
]
??
null
;
}
/**
* {@inheritDoc}
*/
public
function
fetchNumeric
()
{
if
(
!
$this
->
result
)
{
return
false
;
}
return
db2_fetch_array
(
$this
->
stmt
);
}
/**
* {@inheritdoc}
*/
public
function
fetchAssociative
()
{
// do not try fetching from the statement if it's not expected to contain the result
// in order to prevent exceptional situation
if
(
!
$this
->
result
)
{
return
false
;
}
return
db2_fetch_assoc
(
$this
->
stmt
);
}
/**
* {@inheritdoc}
*/
public
function
fetchOne
()
{
return
FetchUtils
::
fetchOne
(
$this
);
}
/**
* {@inheritdoc}
*/
public
function
fetchAllNumeric
()
:
array
{
return
FetchUtils
::
fetchAllNumeric
(
$this
);
}
/**
* {@inheritdoc}
*/
public
function
fetchAllAssociative
()
:
array
{
return
FetchUtils
::
fetchAllAssociative
(
$this
);
}
/**
* {@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