views:

454

answers:

1

I'm trying to do an Outer Join in Symfony. Here's the bit of code that seems like it would work if Criteria supported OUTER_JOIN:

$user = sfContext::getInstance()->getUser();
$petCriteria = new Criteria();
$petCriteria->add(PetInfoPeer::ACCOUNT_ID, $user->getProfile()->getAccountId());
$petCriteria->add(LostPetPeer::PET_INFO_ID, Criteria::ISNULL);
$petCriteria->addJoin(LostPetPeer::PET_INFO_ID, PetInfoPeer::PET_INFO_ID, Criteria::OUTER_JOIN);

Am I missing something? Does Propel 1.3 support it? I've searched everywhere and have only found pseudo code.

+1  A: 

I don't think this is possible using criteria. You'd have to write and run the SQL, then build the models, yourself.

Here's a good example of that, found on this site.

thrashr888
I've confirmed this via IRC #symfony.
thrashr888