From af32f80176c143c84b108d2e696fe0555979bc60 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Thu, 17 Jan 2008 13:26:31 +0000 Subject: [PATCH] Added a fix in toArray method to prevent mapped Doctrine_Record values to be displayed fully --- lib/Doctrine/Record.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 0969a4578..479c60a6c 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -1251,7 +1251,16 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count } } - return array_merge($a, $this->_values); + // [FIX] Prevent mapped Doctrine_Records from being displayed fully + foreach ($this->_values as $key => $value) { + if ($value instanceof Doctrine_Record) { + $a[$key] = $value->toArray($deep, $prefixKey); + } else { + $a[$key] = $value; + } + } + + return $a; } /**