MINOR documentation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73233 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-03-17 20:20:43 +00:00
parent 187a1f6f30
commit a2f6d82379

View File

@ -50,6 +50,9 @@
* } * }
* </code> * </code>
* *
* If any public method on this class is prefixed with an underscore,
* the results are cached in memory through {@link cachedCall()}.
*
* @package sapphire * @package sapphire
* @subpackage model * @subpackage model
*/ */
@ -711,11 +714,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
foreach($classes as $class) { foreach($classes as $class) {
$defaults = Object::get_static($class, 'defaults'); $defaults = Object::get_static($class, 'defaults');
if($defaults) foreach($defaults as $fieldName => $fieldValue) { if($defaults) foreach($defaults as $fieldName => $fieldValue) {
// SRM 2007-03-06: Stricter check // SRM 2007-03-06: Stricter check
if(!isset($this->$fieldName) || $this->$fieldName === null) { if(!isset($this->$fieldName) || $this->$fieldName === null) {
$this->$fieldName = $fieldValue; $this->$fieldName = $fieldValue;
} }
// Set many-many defaults with an array of ids // Set many-many defaults with an array of ids
if(is_array($fieldValue) && $this->many_many($fieldName)) { 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)) { if(isset($ancestry) && is_array($ancestry)) {
foreach($ancestry as $idx => $class) { foreach($ancestry as $idx => $class) {
$classSingleton = singleton($class); $classSingleton = singleton($class);
foreach($this->record as $fieldName => $fieldValue) { foreach($this->record as $fieldName => $fieldValue) {
if(isset($this->changed[$fieldName]) && $this->changed[$fieldName] && $fieldType = $classSingleton->hasOwnTableDatabaseField($fieldName)) { if(isset($this->changed[$fieldName]) && $this->changed[$fieldName] && $fieldType = $classSingleton->hasOwnTableDatabaseField($fieldName)) {
$fieldObj = $this->dbObject($fieldName); $fieldObj = $this->dbObject($fieldName);