2013-05-13 64 views
0

我想是做的就是這個查詢的學說:怎麼做createQuiry聯接教義或DQL

SELECT * 
FROM `reservation` 
JOIN res_chauf ON reservation.reservation_id = res_chauf.reservation_id 
WHERE res_chauf.chauffeur_id =1 

教義/ Symfony2中與DQL 我知道如何做到這一個選擇這樣:

$qb = $em->createQueryBuilder(); 
$qb->select('c') 
    ->from('myBundle:Client', 'c') 
    ->where('c.name LIKE :data') 
    ->orderBy('c.name', 'ASC') 
    ->setParameter('data', '%'.$data.'%'); 
    $query = $qb->getQuery(); 
    $entities = $query->getResult(); 

,但現在我已經加入兩個表

一些幫助,請

謝謝

回答