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
ffe169cd
Commit
ffe169cd
authored
Jul 27, 2006
by
doctrine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
c4cba699
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
Basic Components - Collection - Loading related records.php
...sic Components - Collection - Loading related records.php
+20
-0
Basic Components - Collection - Loading related records.php
...sic Components - Collection - Loading related records.php
+3
-0
No files found.
manual/codes/Basic Components - Collection - Loading related records.php
0 → 100644
View file @
ffe169cd
<?php
$users
=
$session
->
query
(
"FROM User"
);
// now lets load phonenumbers for all users
$users
->
loadRelated
(
"Phonenumber"
);
foreach
(
$users
as
$user
)
{
print
$user
->
Phonenumber
->
phonenumber
;
// no additional db queries needed here
}
// the loadRelated works an any relation, even associations:
$users
->
loadRelated
(
"Group"
);
foreach
(
$users
as
$user
)
{
print
$user
->
Group
->
name
;
}
?>
manual/docs/Basic Components - Collection - Loading related records.php
0 → 100644
View file @
ffe169cd
Doctrine
provides
means
for
effiently
retrieving
all
related
records
for
all
record
elements
.
That
means
when
you
have
for
example
a
collection
of
users
you
can
load
all
phonenumbers
for
all
users
by
simple
calling
the
loadRelated
()
method
.
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