doctrine连接多个表

Just started using doctrine. question. I have a lookup table that does 2 joins. How can I do this in Doctrine?

My SQL statement looks like this in mysql

select * from Business b 
inner join BusinessCategoryLookup on b.BusinessID= BusinessCategoryLookup .BusinessID inner join BusinessCategory bb on b.BusinessCategoryID= BusinessCategoryLookup .BusinessCategoryID;

Essentially I need to return all the business and their associated categories they belong too. The Lookup table is just categoryID, business ID as the columns.

Assuming your Business entity has businessCategoryLookup and businessCategory fields:

SELECT b, bcl, bc FROM YourBundleName:Business
JOIN b.businessCategoryLookup bcl
JOIN b.businessCategory bc

A lot clearer than SQL, eh ? :)