Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Fixed $OR operator in EMongoCriteria.php #53

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

Fixed $OR operator in EMongoCriteria.php #53

ardin opened this issue Sep 2, 2011 · 0 comments

Comments

@ardin
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant