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
49cf37af
Commit
49cf37af
authored
Jan 04, 2015
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for object hydration in oci8 driver
parent
a8f66a29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+21
-3
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+0
-6
No files found.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
49cf37af
...
...
@@ -243,11 +243,19 @@ class OCI8Statement implements \IteratorAggregate, Statement
public
function
fetch
(
$fetchMode
=
null
)
{
$fetchMode
=
$fetchMode
?:
$this
->
_defaultFetchMode
;
if
(
!
isset
(
self
::
$fetchModeMap
[
$fetchMode
]))
{
if
(
PDO
::
FETCH_OBJ
==
$fetchMode
)
{
return
oci_fetch_object
(
$this
->
_sth
);
}
if
(
!
isset
(
self
::
$fetchModeMap
[
$fetchMode
]))
{
throw
new
\InvalidArgumentException
(
"Invalid fetch style: "
.
$fetchMode
);
}
return
oci_fetch_array
(
$this
->
_sth
,
self
::
$fetchModeMap
[
$fetchMode
]
|
OCI_RETURN_NULLS
|
OCI_RETURN_LOBS
);
return
oci_fetch_array
(
$this
->
_sth
,
self
::
$fetchModeMap
[
$fetchMode
]
|
OCI_RETURN_NULLS
|
OCI_RETURN_LOBS
);
}
/**
...
...
@@ -256,11 +264,21 @@ class OCI8Statement implements \IteratorAggregate, Statement
public
function
fetchAll
(
$fetchMode
=
null
)
{
$fetchMode
=
$fetchMode
?:
$this
->
_defaultFetchMode
;
$result
=
array
();
if
(
PDO
::
FETCH_OBJ
==
$fetchMode
)
{
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
$result
[]
=
$row
;
}
return
$result
;
}
if
(
!
isset
(
self
::
$fetchModeMap
[
$fetchMode
]))
{
throw
new
\InvalidArgumentException
(
"Invalid fetch style: "
.
$fetchMode
);
}
$result
=
array
();
if
(
self
::
$fetchModeMap
[
$fetchMode
]
===
OCI_BOTH
)
{
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
$result
[]
=
$row
;
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
49cf37af
...
...
@@ -646,12 +646,6 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
*/
public
function
testFetchAllStyleObject
()
{
$driverName
=
$this
->
_conn
->
getDriver
()
->
getName
();
if
(
in_array
(
$driverName
,
array
(
'oci8'
),
true
))
{
$this
->
markTestSkipped
(
sprintf
(
'Driver "%s" does not support hydrating data to an object.'
,
$driverName
));
}
$this
->
setupFixture
();
$sql
=
'SELECT test_int, test_string, test_datetime FROM fetch_table'
;
...
...
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