[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-22 Thread Dheeraj Kumar Aggarwal
hi i think this should work $this->howManyToPage = 6; $c = new Criteria(); $criterion = $c->getNewCriterion(WeblogPeer::CATEGORY, 'general', Criteria::NOT_EQUAL); $criterion->addAnd($c->getNewCriterion(WeblogPeer::CATEGORY, 'featured', Criteria::NOT_EQUAL);); // $criterion->addOr(

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-22 Thread cokker
to see the executed queries you can have a look here: http://forum.symfony-project.org/index.php/t/18373/ greets Sven Lawrence Krubner schrieb: > I have this code: > > $this->howManyToPage = 6; > $c = new Criteria(); > $c->add(WeblogPeer::CATEGORY, "general", Criteria::NOT_EQUAL);

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-23 Thread Lawrence Krubner
getNewCriterion() ??? Where is this documented? On Apr 22, 11:40 pm, Dheeraj Kumar Aggarwal wrote: > hi >    i think this should work > >    $this->howManyToPage = 6; >    $c = new Criteria(); >    $criterion = $c->getNewCriterion(WeblogPeer::CATEGORY, 'general', > Criteria::NOT_EQUAL); >    $

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-23 Thread cokker
Here: http://propel.phpdb.org/docs/user_guide/chapters/FindingObjects.html#FindingRecods.Criteria greets Sven Lawrence Krubner schrieb: > getNewCriterion() ??? > > Where is this documented? > > > On Apr 22, 11:40 pm, Dheeraj Kumar Aggarwal > wrote: >> hi >>i think this should work >> >>

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-23 Thread Lawrence Krubner
Thanks much for this. I wish Criteria/Propel was better documented. On Apr 22, 11:40 pm, Dheeraj Kumar Aggarwal wrote: > hi >    i think this should work > >    $this->howManyToPage = 6; >    $c = new Criteria(); >    $criterion = $c->getNewCriterion(WeblogPeer::CATEGORY, 'general', > Criteria:

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-23 Thread naholyr
It's important to know how Criterion works, but in this particular case you'd better simply use IN operator : $c = new Criteria(); $c->add(WeblogPeer::CATEGORY, array("general", "featured"), Criteria::IN); $c->add(WeblogPeer::ACTIVE, "0", Criteria::NOT_EQUAL); $c->addDescendingOr

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-23 Thread Gareth McCumskey
I thought I would just point out. $c->add(WeblogPeer::CATEGORY, "general", Criteria::NOT_EQUAL); $c->add(WeblogPeer::CATEGORY, "featured", Criteria::NOT_EQUAL); Those statements do not create an OR or an AND. In fact what happens is that the second one over writes the first because they both

[symfony-users] Re: Propel question: how to get AND instead of OR

2009-04-23 Thread Garakkio
This can be very helpful in such situations: Propel Criteria Builder http://propel.jondh.me.uk/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-user