mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
MINOR ModelAdmin documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@73337 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
be985afd24
commit
caa961e4fb
@ -685,7 +685,24 @@ class ModelAdmin_CollectionController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a form suitable for adding a new model, falling back on the default edit form
|
* Returns a form suitable for adding a new model, falling back on the default edit form.
|
||||||
|
*
|
||||||
|
* Caution: The add-form shows a DataObject's {@link DataObject->getCMSFields()} method on a record
|
||||||
|
* that doesn't exist in the database yet, hence has no ID. This means the {@link DataObject->getCMSFields()}
|
||||||
|
* implementation has to ensure that no fields are added which would rely on a
|
||||||
|
* record ID being present, e.g. {@link HasManyComplexTableField}.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* <code>
|
||||||
|
* function getCMSFields() {
|
||||||
|
* $fields = parent::getCMSFields();
|
||||||
|
* if($this->exists()) {
|
||||||
|
* $ctf = new HasManyComplexTableField($this, 'MyRelations', 'MyRelation');
|
||||||
|
* $fields->addFieldToTab('Root.Main', $ctf);
|
||||||
|
* }
|
||||||
|
* return $fields;
|
||||||
|
* }
|
||||||
|
* </code>
|
||||||
*
|
*
|
||||||
* @return Form
|
* @return Form
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user