[symfony-users] Re: Multiple criteria for same column [was: Criteria stored in DB]

2008-06-05 Thread Tom Haskins-Vaughan
Perfect. Thanks, Scott. I'll give it a go Stereo wrote: > Hi Tom, > > You can do this: > $c1 = $c->getNewCriterion(PropertyPeer::PRICE, 20, > Criteria::GREATER_EQUAL); > $c2 = $c->getNewCriterion(PropertyPeer::PRICE, 205000, > Criteria::LESS_THAN); > > // combine them into one statement > $

[symfony-users] Re: Multiple criteria for same column [was: Criteria stored in DB]

2008-06-05 Thread Stereo
Hi Tom, You can do this: $c1 = $c->getNewCriterion(PropertyPeer::PRICE, 20, Criteria::GREATER_EQUAL); $c2 = $c->getNewCriterion(PropertyPeer::PRICE, 205000, Criteria::LESS_THAN); // combine them into one statement $c1->addAnd($c2); // add to criteria; $c->add($c1); You can explore chainin