From a2f6d823796f96895b90edc7508f81dc783a612a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 17 Mar 2009 20:20:43 +0000 Subject: [PATCH] MINOR documentation git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73233 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObject.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/model/DataObject.php b/core/model/DataObject.php index e8198be83..116261a47 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -50,6 +50,9 @@ * } * * + * If any public method on this class is prefixed with an underscore, + * the results are cached in memory through {@link cachedCall()}. + * * @package sapphire * @subpackage model */ @@ -711,11 +714,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity foreach($classes as $class) { $defaults = Object::get_static($class, 'defaults'); - if($defaults) foreach($defaults as $fieldName => $fieldValue) { // SRM 2007-03-06: Stricter check if(!isset($this->$fieldName) || $this->$fieldName === null) { $this->$fieldName = $fieldValue; + } // Set many-many defaults with an array of ids if(is_array($fieldValue) && $this->many_many($fieldName)) { @@ -833,7 +836,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity if(isset($ancestry) && is_array($ancestry)) { foreach($ancestry as $idx => $class) { $classSingleton = singleton($class); - foreach($this->record as $fieldName => $fieldValue) { if(isset($this->changed[$fieldName]) && $this->changed[$fieldName] && $fieldType = $classSingleton->hasOwnTableDatabaseField($fieldName)) { $fieldObj = $this->dbObject($fieldName);