All pastes #762140 Raw Edit

Something

public text v1 · immutable
·published 2007-11-05 12:47 UTC
rendered paste body
Here's the code:
		// List gangs
		$c = new Criteria();
		$c->addJoin(GangPeer::GANG_USER, UserPeer::ID, Criteria::LEFT_JOIN);
		$c->addJoin(GangPeer::GANG_COUNTRY, CountryPeer::ID);
		
		$gangs = GangPeer::doSelect($c);

And here's the SQL:
SELECT gang.ID, gang.GANG_USER, gang.GANGNAME, gang.GANGABREVIATION, gang.DESCRIPTION, gang.GANG_COUNTRY 
       FROM (gang, country) 
       LEFT JOIN user ON (gang.GANG_USER=user.ID) 
       WHERE gang.GANG_COUNTRY=country.ID