Skip to content
Browse files

Fix criteria from array bug

  • Loading branch information...
1 parent 3f8d8f0 commit 189b2a9e28da1fb9c3042ca9c85ae4924d5553cf @canni canni committed Dec 7, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 EMongoCriteria.php
  2. +1 −1 extra/EMongoUniqueValidator.php
View
2 EMongoCriteria.php
@@ -77,7 +77,7 @@ public function __construct($criteria=null)
{
$operator = strtolower(array_shift($cond));
$value = array_shift($cond);
- call_user_func_array(array($this, $operator), array($fieldName, $value));
+ call_user_func_array(array($this, $fieldName), array($operator, $value));
}
if(isset($criteria['select']))
$this->select($criteria['select']);
View
2 extra/EMongoUniqueValidator.php
@@ -12,7 +12,7 @@ public function validateAttribute($object, $attribute)
$criteria = new EMongoCriteria;
$criteria->{$attribute} = $value;
- $count = $object::model()->count($criteria);
+ $count = $object->model()->count($criteria);
if($count !== 0)
$this->addError(

0 comments on commit 189b2a9

Please sign in to comment.
Something went wrong with that request. Please try again.