Skip to content

Commit

Permalink
Fixing the noobness again
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam authored and Sam committed Jun 21, 2013
1 parent 8903ca7 commit 593e957
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions EMongoDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,10 @@ public function search($query=array()){
foreach($this->getSafeAttributeNames() as $attribute){

$value = $this->{$attribute};
if(($value !== null && $value !== '') || (is_array($value)&&count($value))){
if(is_array($value) || is_object($value)){
if($value !== null && $value !== ''){
if((is_array($value) && count($value)) || is_object($value)){
$query[$attribute] = $value;
}elseif(preg_match('/^(?:\s*(<>|<=|>=|<|>|=))?(.*)$/',$value,$matches)){
}elseif(is_string($value)&&preg_match('/^(?:\s*(<>|<=|>=|<|>|=))?(.*)$/',$value,$matches)){
$value=$matches[2];
$op=$matches[1];

Expand Down

0 comments on commit 593e957

Please sign in to comment.