Fixed $OR operator in EMongoCriteria.php #53

Open
ardin opened this Issue Sep 2, 2011 · 0 comments

Comments

Projects
None yet
1 participant

ardin commented Sep 2, 2011

Hi,

EMongoCriteria works better (for me) if you replace code in function addCond to

if($op == self::$operators['or'])
                {
                        if(!isset($this->_conditions[$op]))
                        {
                                $this->_conditions[$op] = array();
                        }
                        // disabled
                        // $this->_conditions[$op][] = array($fieldName=>$value);

                        // added

                        if (!is_array($value))
                                $this->_conditions[$op][] = array($fieldName=>$value);
                        else
                                foreach($value as $row)
                                {
                                        $this->_conditions[$op][] = array($fieldName=>$row);
                                }
                    
                }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment