diff --git a/EMongoDocument.php b/EMongoDocument.php index 0cbe4b7..0fbb622 100644 --- a/EMongoDocument.php +++ b/EMongoDocument.php @@ -599,6 +599,8 @@ public function equals($record) */ public function findOne($criteria = array(), $fields = array()){ $this->trace(__FUNCTION__); + + $this->beforeFind(); // Apparently this is applied before even scopes... if($criteria instanceof EMongoCriteria) $criteria = $criteria->getCondition(); @@ -650,7 +652,9 @@ public function findAllByPk($pk, $fields = array()){ */ public function find($criteria = array(), $fields = array()){ $this->trace(__FUNCTION__); - + + $this->beforeFind(); // Apparently this is applied before even scopes... + if($criteria instanceof EMongoCriteria){ $c = $criteria->mergeWith($this->getDbCriteria())->toArray(); $criteria = array();