Propel - Sympony - Conditions in OR in Criteria



Propel:
$c = new Criteria();

$cton1 = $c->getNewCriterion(AuthorPeer::FIRST_NAME, “Leo”);

$cton2 = $c->getNewCriterion(AuthorPeer::LAST_NAME,
array(”Tolstoy”, “Dostoevsky”, “Bakhtin”), Criteria::IN);

$cton1->addOr($cton2);

// add to Criteria

$c->add($cton1);

$authors = AuthorPeer::doSelect($c);

Leave a Reply

You must be logged in to post a comment.