From aec85da43ec0734fef1a0d17405c5d72b7c32512 Mon Sep 17 00:00:00 2001 From: Sammaye Date: Wed, 26 Feb 2014 09:46:00 +0000 Subject: [PATCH] Fixed bug in previous commit --- EMongoModel.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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