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
a1b4b0f7
Commit
a1b4b0f7
authored
Oct 01, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified object population
parent
5de6c0a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
48 deletions
+0
-48
Collection.php
lib/Doctrine/Collection.php
+0
-35
Hydrate.php
lib/Doctrine/Hydrate.php
+0
-13
No files found.
lib/Doctrine/Collection.php
View file @
a1b4b0f7
...
@@ -520,41 +520,6 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
...
@@ -520,41 +520,6 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
return
true
;
return
true
;
}
}
/**
* populate
*
* @param Doctrine_Query $query
* @param integer $key
*/
public
function
populate
(
Doctrine_Hydrate
$query
)
{
$name
=
$this
->
table
->
getComponentName
();
if
(
$this
instanceof
Doctrine_Collection_Immediate
||
$this
instanceof
Doctrine_Collection_Offset
)
{
$data
=
$query
->
getData
(
$name
);
if
(
is_array
(
$data
))
{
foreach
(
$data
as
$k
=>
$v
)
:
$this
->
table
->
setData
(
$v
);
$this
->
add
(
$this
->
table
->
getRecord
());
endforeach
;
}
}
elseif
(
$this
instanceof
Doctrine_Collection_Batch
)
{
$this
->
data
=
$query
->
getData
(
$name
);
if
(
isset
(
$this
->
keyColumn
))
{
foreach
(
$this
->
data
as
$k
=>
$v
)
{
$value
=
$record
->
get
(
$this
->
keyColumn
);
if
(
$value
===
null
)
throw
new
Doctrine_Collection_Exception
(
"Couldn't create collection index. Record field '"
.
$this
->
keyColumn
.
"' was null."
);
$this
->
data
[
$value
]
=
$record
;
unset
(
$this
->
data
[
$k
]);
}
}
}
}
/**
/**
* loadRelated
* loadRelated
*
*
...
...
lib/Doctrine/Hydrate.php
View file @
a1b4b0f7
...
@@ -222,20 +222,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
...
@@ -222,20 +222,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
throw
new
Doctrine_Exception
(
"Unknown fetchmode"
);
throw
new
Doctrine_Exception
(
"Unknown fetchmode"
);
endswitch
;
endswitch
;
$coll
->
populate
(
$this
);
return
$coll
;
return
$coll
;
}
}
/**
* getData
* @param $key the component name
* @return array the data row for the specified component
*/
final
public
function
getData
(
$key
)
{
if
(
isset
(
$this
->
data
[
$key
])
&&
is_array
(
$this
->
data
[
$key
]))
return
$this
->
data
[
$key
];
return
array
();
}
/**
/**
* convertBoolean
* convertBoolean
* converts boolean to integers
* converts boolean to integers
...
@@ -255,7 +243,6 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
...
@@ -255,7 +243,6 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
* @return Doctrine_Collection the root collection
* @return Doctrine_Collection the root collection
*/
*/
public
function
execute
(
$params
=
array
(),
$return
=
Doctrine
::
FETCH_RECORD
)
{
public
function
execute
(
$params
=
array
(),
$return
=
Doctrine
::
FETCH_RECORD
)
{
$this
->
data
=
array
();
$this
->
collections
=
array
();
$this
->
collections
=
array
();
array_walk
(
$params
,
array
(
__CLASS__
,
'convertBoolean'
));
array_walk
(
$params
,
array
(
__CLASS__
,
'convertBoolean'
));
...
...
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