Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top