From 5c1132f6da292a689bc52bd7f20a83ff8d733fbd Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 26 Jul 2006 01:44:57 +0000 Subject: Allow nested GroupBy result maps --- framework/DataAccess/SQLMap/DataMapper/TPropertyAccess.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'framework/DataAccess/SQLMap/DataMapper/TPropertyAccess.php') diff --git a/framework/DataAccess/SQLMap/DataMapper/TPropertyAccess.php b/framework/DataAccess/SQLMap/DataMapper/TPropertyAccess.php index e4f5c1fa..dbd4d6e7 100644 --- a/framework/DataAccess/SQLMap/DataMapper/TPropertyAccess.php +++ b/framework/DataAccess/SQLMap/DataMapper/TPropertyAccess.php @@ -96,13 +96,17 @@ class TPropertyAccess return true; } - public static function set($object, $path, $value) + public static function set(&$object, $path, $value) { $properties = explode('.', $path); $prop = array_pop($properties); if(count($properties) > 0) $object = self::get($object, implode('.',$properties)); - if(is_object($object)) + if(is_array($object) || $object instanceof ArrayAccess) + { + $object[$prop] = $value; + } + else if(is_object($object)) { $setter = 'set'.$prop; if(is_callable(array($object, $setter))) -- cgit v1.2.3