Commit ffe169cd authored by doctrine's avatar doctrine

--no commit message

--no commit message
parent c4cba699
<?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;
}
?>
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.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment