diff --git a/EMongoModel.php b/EMongoModel.php index 079f260..9792fd0 100644 --- a/EMongoModel.php +++ b/EMongoModel.php @@ -32,11 +32,12 @@ public function __get($name){ try { return parent::__get($name); } catch (CException $e) { - if(method_exists($this,$getter)) + $getter='get'.$name; + if(method_exists($this,$getter)){ throw $e; - elseif(strncasecmp($name,'on',2)===0 && method_exists($this,$name)) + }elseif(strncasecmp($name,'on',2)===0 && method_exists($this,$name)){ throw $e; - + } return null; } } @@ -602,4 +603,4 @@ public function getJSONDocument(){ public function getBSONDocument(){ return bson_encode($this->getRawDocument()); } -} +} \ No newline at end of file