All pastes #814050 Raw Edit

hal

public text v1 · immutable
·published 2007-12-12 23:30 UTC
rendered paste body
The two pieces of code produce the same data output, except that the first performs it in only 1 query:
new Criteria()

$c = new Criteria();
$c->(PermGroupPeer::GROUP_ID, 1)
$this->perm_groups = PermGroupPeer::doSelectJoinUser();



and the following performs it in 6 queries:

$c = new Criteria();
$c->addJoin(PermGroupPeer::UPDATEDBY_USER_ID,UserPeer::USER_ID, Criteria::INNER_JOIN);
$this->perm_groups = PermGroupPeer::doSelect($c);