De-enforcing key naming conventions when converting Model results to object

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3604 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-10-06 18:39:38 +00:00
parent 1b976ee89b
commit 7df9917319

View file

@ -105,6 +105,11 @@ class Set extends Object {
}
function __map($value, $class, $identity = null) {
if (is_object($value)) {
return $value;
}
if (!empty($value) && Set::numeric(array_keys($value))) {
$ret = array();
foreach ($value as $key => $val) {
@ -124,7 +129,7 @@ class Set extends Object {
$keys = array_keys($value);
foreach ($value as $key => $val) {
if (!is_numeric($key) && strlen($key) > 1) {
if ($key{0} == strtoupper($key{0}) && $key{1} == strtolower($key{1})) {
if ($key{0} == strtoupper($key{0}) && $key{1} == strtolower($key{1}) && (is_array($val) || is_object($val))) {
if ($key == $keys[0]) {
$ret = Set::__map($val, $class, $key);
} else {