diff --git a/core/model/DataObjectDecorator.php b/core/model/DataObjectDecorator.php index f43fc4e4c..b27b994b5 100755 --- a/core/model/DataObjectDecorator.php +++ b/core/model/DataObjectDecorator.php @@ -10,7 +10,7 @@ * DataObject decorators add extra functionality to your data objects. */ abstract class DataObjectDecorator extends Extension { - + /** * Load the extra database fields defined in extraDBFields. */ @@ -19,7 +19,10 @@ abstract class DataObjectDecorator extends Extension { $className = $this->owner->class; if($fields) { foreach($fields as $relationType => $fields) { - if(in_array($relationType, array('db','has_one','many_many','belongs_many_many','many_many_extraFields'))) { + if(in_array($relationType, array('db', 'has_one', 'indexes', + 'defaults', 'many_many', + 'belongs_many_many', + 'many_many_extraFields'))) { eval("$className::\$$relationType = array_merge((array){$className}::\$$relationType, (array)\$fields);"); } } @@ -33,14 +36,14 @@ abstract class DataObjectDecorator extends Extension { function augmentSQL(SQLQuery &$query) { } - + /** * Update the database schema as required by this extension. */ function augmentDatabase() { } - + /** * Define extra database fields. * Return an map where the keys are db, has_one, etc, and the values are additional fields / relations to be defined. @@ -51,7 +54,7 @@ abstract class DataObjectDecorator extends Extension { /** * This function is used to provide modifications to the form in the CMS by the - * decorator. By default, no changes are made - if you want you can overload + * decorator. By default, no changes are made - if you want you can overload * this function. */ function updateCMSFields(FieldSet &$fields) {