From 23757f1c010f0d6123e52c89a3c29caa1a6373ef Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Wed, 26 Oct 2011 09:57:31 +0000 Subject: proposed patch for #325 --- framework/Util/TDataFieldAccessor.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php index ac747556..1b494b18 100644 --- a/framework/Util/TDataFieldAccessor.php +++ b/framework/Util/TDataFieldAccessor.php @@ -4,7 +4,7 @@ * * @author Qiang Xue * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2011 PradoSoft + * @copyright Copyright © 2005-2011 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Util @@ -58,16 +58,16 @@ class TDataFieldAccessor { if(strpos($field,'.')===false) // simple field { - if(property_exists($data,$field)) - return $data->{$field}; - else + if(method_exists($data, 'get'.$field)) return call_user_func(array($data,'get'.$field)); + else + return $data->{$field}; } else // field in the format of xxx.yyy.zzz { $object=$data; foreach(explode('.',$field) as $f) - $object = TDataFieldAccessor::getDataFieldValue($object, $f); + $object = TDataFieldAccessor::getDataFieldValue($object, $f); return $object; } } -- cgit v1.2.3