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
a478dfa4
Commit
a478dfa4
authored
Sep 05, 2007
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed hydration constants from doctrine_hydrate
parent
d9a5bbd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
16 deletions
+8
-16
Hydrate.php
lib/Doctrine/Hydrate.php
+7
-15
FetchModeTestCase.php
tests/Hydrate/FetchModeTestCase.php
+1
-1
No files found.
lib/Doctrine/Hydrate.php
View file @
a478dfa4
...
...
@@ -58,14 +58,6 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
* constant for CREATE queries
*/
const
CREATE
=
4
;
/**
* Constant for the array hydration mode.
*/
const
HYDRATE_ARRAY
=
3
;
/**
* Constant for the record (object) hydration mode.
*/
const
HYDRATE_RECORD
=
2
;
/**
* @var array $params query input parameters
...
...
@@ -149,7 +141,7 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
/**
* The current hydration mode.
*/
protected
$_hydrationMode
=
self
::
HYDRATE_RECORD
;
protected
$_hydrationMode
=
Doctrine
::
HYDRATE_RECORD
;
/**
* @var boolean $_expireCache a boolean value that indicates whether or not to force cache expiration
*/
...
...
@@ -296,7 +288,7 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
/**
* Sets the fetchmode.
*
* @param integer $fetchmode One of the Doctrine
_Hydrate
::HYDRATE_* constants.
* @param integer $fetchmode One of the Doctrine::HYDRATE_* constants.
*/
public
function
setHydrationMode
(
$hydrationMode
)
{
...
...
@@ -800,7 +792,7 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
if
(
$cached
===
null
)
{
// cache miss
$stmt
=
$this
->
_execute
(
$params
);
$array
=
$this
->
parseData2
(
$stmt
,
self
::
HYDRATE_ARRAY
);
$array
=
$this
->
parseData2
(
$stmt
,
Doctrine
::
HYDRATE_ARRAY
);
$cached
=
$this
->
getCachedForm
(
$array
);
...
...
@@ -923,7 +915,7 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
* @return array
*/
public
function
fetchArray
(
$params
=
array
())
{
return
$this
->
execute
(
$params
,
self
::
HYDRATE_ARRAY
);
return
$this
->
execute
(
$params
,
Doctrine
::
HYDRATE_ARRAY
);
}
/**
* fetchOne
...
...
@@ -943,11 +935,11 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
$collection
=
$this
->
execute
(
$params
,
$hydrationMode
);
switch
(
$hydrationMode
)
{
case
self
::
HYDRATE_RECORD
:
case
Doctrine
::
HYDRATE_RECORD
:
if
(
count
(
$collection
)
>
0
)
{
return
$collection
->
getFirst
();
}
case
self
::
HYDRATE_ARRAY
:
case
Doctrine
::
HYDRATE_ARRAY
:
return
array_shift
(
$collection
);
}
...
...
@@ -978,7 +970,7 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
$hydrationMode
=
$this
->
_hydrationMode
;
}
if
(
$hydrationMode
===
self
::
HYDRATE_ARRAY
)
{
if
(
$hydrationMode
===
Doctrine
::
HYDRATE_ARRAY
)
{
$driver
=
new
Doctrine_Hydrate_Array
();
}
else
{
$driver
=
new
Doctrine_Hydrate_Record
();
...
...
tests/Hydrate/FetchModeTestCase.php
View file @
a478dfa4
...
...
@@ -157,7 +157,7 @@ class Doctrine_Hydrate_FetchMode_TestCase extends Doctrine_UnitTestCase
$q
=
new
Doctrine_Query
();
$q
->
select
(
'u.*'
)
->
from
(
'User u'
)
->
where
(
'u.id = ?'
);
$users
=
$q
->
execute
(
array
(
$u
->
id
),
Doctrine
_Hydrate
::
HYDRATE_ARRAY
);
$users
=
$q
->
execute
(
array
(
$u
->
id
),
Doctrine
::
HYDRATE_ARRAY
);
$this
->
assertEqual
(
$users
[
0
][
'created'
],
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