Did you try Propel criteria builder? http://propel.jondh.me.uk/criteria/analyse Also, you can use sfPropel15plugin and benefit from new Query syntax.
On 15 Mar, 14:43, HAUSa <jeroen_heeft_behoefte_aan_r...@hotmail.com> wrote: > If you want to make OR term in Propel, you need to make a Criterion > object that adds the OR terms to the Criteria object. > > Now I build my Criteria by use of several functions. This is the > first: > > public static function getAttentionCriteria(Criteria $oCriteria = > NULL){ > if($oCriteria == NULL) $oCriteria = new Criteria(); > else $oCriteria = clone $oCriteria; > > $oCriteria->setDistinct(self::ID); > $oCriterion = $oCriteria->getNewCriterion(self::ADDRESS, '', > Criteria::EQUAL); > $oCriterion->addOr($oCriteria->getNewCriterion(self::CITY, > '', > Criteria::EQUAL)); > $oCriteria->add($oCriterion); > > return $oCriteria; > } > > Another function needs to use the very same Criteria, but with an > extra OR term added. This is the function: > > public static function getExtendedAttentionCriteria(Criteria > $oCriteria = NULL){ > if($oCriteria == NULL) $oCriteria = new Criteria(); > else $oCriteria = clone $oCriteria; > > $oCriteria = self::getAttentionCriteria($oCriteria); > > $oCriterion = $oCriteria ->getNewCriterion(self::IMAGE_ID, > NULL, > Criteria::EQUAL); > $oCriteria->addOr($oCriterion); > > return $oCriteria; > } > > But the last extra OR term (self::IMAGE_ID is equal to NULL) is always > only added in an AND term. > How can I extend the first Criteria from getAttentionCriteria and add > the self::IMAGE_ID is equal to NULL as an OR term? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en