1
0
mirror of synced 2024-12-16 16:16:04 +03:00
doctrine2/manual/codes/Basic Components - Query - FROM - selecting tables.php

25 lines
585 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?php
// find all groups
$coll = $q->from("FROM Group");
2006-07-24 01:08:06 +04:00
// find all users and user emails
2006-12-04 02:40:32 +03:00
$coll = $q->from("FROM User u LEFT JOIN u.Email e");
2006-08-17 13:42:18 +04:00
// find all users and user emails with only user name and
2006-08-17 13:42:18 +04:00
// age + email address loaded
$coll = $q->select('u.name, u.age, e.address')
->from('FROM User u')
->leftJoin('u.Email e')
->execute();
2006-08-17 13:42:18 +04:00
// find all users, user email and user phonenumbers
2006-07-24 01:08:06 +04:00
$coll = $q->from('FROM User u')
2006-12-16 01:31:28 +03:00
->innerJoin('u.Email e')
->innerJoin('u.Phonenumber p')
->execute();
2006-07-24 01:08:06 +04:00
?>