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
6ed2e63d
Commit
6ed2e63d
authored
Oct 22, 2007
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added hydration mode HYDRATE_NONE
parent
1ac6d509
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
Doctrine.php
lib/Doctrine.php
+5
-0
Hydrate.php
lib/Doctrine/Hydrate.php
+5
-2
FetchModeTestCase.php
tests/Hydrate/FetchModeTestCase.php
+13
-0
RecordTestCase.php
tests/RecordTestCase.php
+1
-0
No files found.
lib/Doctrine.php
View file @
6ed2e63d
...
...
@@ -359,6 +359,11 @@ final class Doctrine
* HYDRATE_ARRAY
*/
const
HYDRATE_ARRAY
=
3
;
/**
* HYDRATE_NONE
*/
const
HYDRATE_NONE
=
4
;
/**
* VALIDATION CONSTANTS
...
...
lib/Doctrine/Hydrate.php
View file @
6ed2e63d
...
...
@@ -882,7 +882,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
if
(
is_integer
(
$stmt
))
{
return
$stmt
;
}
$array
=
$this
->
parseData2
(
$stmt
,
$hydrationMode
);
}
return
$array
;
...
...
@@ -1024,7 +1024,10 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
*/
public
function
parseData2
(
$stmt
,
$hydrationMode
)
{
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_NONE
)
{
return
$stmt
->
fetchAll
(
PDO
::
FETCH_NUM
);
}
$cache
=
array
();
$rootMap
=
reset
(
$this
->
_aliasMap
);
$rootAlias
=
key
(
$this
->
_aliasMap
);
...
...
tests/Hydrate/FetchModeTestCase.php
View file @
6ed2e63d
...
...
@@ -160,4 +160,17 @@ class Doctrine_Hydrate_FetchMode_TestCase extends Doctrine_UnitTestCase
$users
=
$q
->
execute
(
array
(
$u
->
id
),
Doctrine
::
HYDRATE_ARRAY
);
$this
->
assertEqual
(
$users
[
0
][
'created'
],
null
);
}
public
function
testHydrateNone
()
{
$u
=
new
User
();
$u
->
name
=
"fetch_array_test"
;
$u
->
created
=
null
;
$u
->
save
();
$q
=
new
Doctrine_Query
();
$q
->
select
(
'COUNT(u.id) num'
)
->
from
(
'User u'
)
->
where
(
'u.id = ?'
);
$res
=
$q
->
execute
(
array
(
$u
->
id
),
Doctrine
::
HYDRATE_NONE
);
$this
->
assertEqual
(
1
,
$res
[
0
][
0
]);
}
}
tests/RecordTestCase.php
View file @
6ed2e63d
...
...
@@ -240,6 +240,7 @@ class Doctrine_Record_TestCase extends Doctrine_UnitTestCase
$this
->
connection
->
clear
();
$user
=
$this
->
connection
->
getTable
(
'User'
)
->
find
(
5
);
$this
->
assertEqual
(
$user
->
name
,
null
);
}
...
...
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