summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorctrlaltca <>2012-11-02 16:52:57 +0000
committerctrlaltca <>2012-11-02 16:52:57 +0000
commitffe46625821b5d23387d57c289dafc37a52203d7 (patch)
tree6fae7ebf41da690dfa3f816c182f31af6ffb0c9c
parentf1a5bcead5e929815a8acadb8cef3286186c138e (diff)
fix #426
-rw-r--r--framework/Util/TDataFieldAccessor.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php
index b96cf0c9..e25151db 100644
--- a/framework/Util/TDataFieldAccessor.php
+++ b/framework/Util/TDataFieldAccessor.php
@@ -53,7 +53,15 @@ class TDataFieldAccessor
try
{
if(is_array($data) || ($data instanceof ArrayAccess))
- return $data[$field];
+ {
+ if(isset($data[$field]))
+ return $data[$field];
+
+ $tmp = $data;
+ foreach (explode(".", $field) as $f)
+ $tmp = $tmp[$f];
+ return $tmp;
+ }
else if(is_object($data))
{
if(strpos($field,'.')===false) // simple field
@@ -79,4 +87,3 @@ class TDataFieldAccessor
throw new TInvalidDataValueException('datafieldaccessor_data_invalid',$field);
}
}
-