1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/manual/codes/Basic Components - Query - FROM - selecting tables.php
2006-12-15 22:31:28 +00:00

25 lines
585 B
PHP

<?php
// find all groups
$coll = $q->from("FROM Group");
// find all users and user emails
$coll = $q->from("FROM User u LEFT JOIN u.Email e");
// find all users and user emails with only user name and
// age + email address loaded
$coll = $q->select('u.name, u.age, e.address')
->from('FROM User u')
->leftJoin('u.Email e')
->execute();
// find all users, user email and user phonenumbers
$coll = $q->from('FROM User u')
->innerJoin('u.Email e')
->innerJoin('u.Phonenumber p')
->execute();
?>