diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 8c300a6c3..5d9439e6c 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1178,20 +1178,20 @@ class MyAddressField extends } ``` -### `DataObject::database_fields` or `DataObject::db` {#dataobject-db-database-fields} +### Removed `DataObject::database_fields` or `DataObject::db` {#dataobject-db-database-fields} -These methods have been updated to include base fields (such as ID, ClassName, Created, and LastEdited), as -well as composite DB fields. +The methods `DataObject::database_fields()`, `DataObject::custom_database_fields()` and `DataObject::db()` have +been removed. + +Instead, to get all database fields for a dataobject, including base fields (such as ID, ClassName, Created, and LastEdited), use `DataObject::getSchema()->databaseFields($className, $aggregate = true)`. +To omit the base fields, pass a value of `false` as the `$aggregate` parameter, e.g. `DataObject::getSchema()->databaseFields(Member::class, false)`. `DataObject::database_fields` does not have a second parameter anymore, and can be called directly on an object or class. E.g. `Member::database_fields()`. If user code requires the list of fields excluding base fields, then use custom_database_fields instead, or make sure to call `unset($fields['ID']);` if this field should be excluded. -`DataObject:db()` will return all logical fields, including foreign key ids and composite DB Fields, alongside -any child fields of these composites. This method can now take a second parameter $includesTable, which -when set to true (with a field name as the first parameter), will also include the table prefix in -`Table.ClassName(args)` format. +Composite database fields are omitted from the `databaseFields()` method. To get those, use `DataObject::getSchema()->compositeFields($className, $aggregate = true)`. ### Rewrite SQLQuery to more specific classes {#sqlquery}