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 ++++++-- framework/DataAccess/SQLMap/DataMapper/messages.txt | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'framework/DataAccess/SQLMap/DataMapper') 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))) diff --git a/framework/DataAccess/SQLMap/DataMapper/messages.txt b/framework/DataAccess/SQLMap/DataMapper/messages.txt index 16be9c2b..47bb06e7 100644 --- a/framework/DataAccess/SQLMap/DataMapper/messages.txt +++ b/framework/DataAccess/SQLMap/DataMapper/messages.txt @@ -62,4 +62,6 @@ sqlmap_unable_to_find_resource = 'Unable to find SQLMap configuration file '{0 sqlmap_query_execution_error = Error in executing SQLMap statement '{0}' : '{1}'. sqlmap_undefined_discriminator = The discriminator is null, but somehow a subMap was reached in ResultMap '{0}' in file '{1}'. sqlmap_invalid_delegate = Invalid callback row delegate '{1}' in mapped statement '{0}'. -sqlmap_invalid_prado_cache = Unable to find Prado cache module for SQLMap cache '{0}'. \ No newline at end of file +sqlmap_invalid_prado_cache = Unable to find Prado cache module for SQLMap cache '{0}'. + +sqlmap_non_groupby_array_list_type = Expecting GroupBy property in result map '{0}' since {1}::{2} is an array or TList type. \ No newline at end of file -- cgit v1.2.3