mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
MINOR Relying on field scaffolding in Company (now that FormScaffolder uses GridField)
This commit is contained in:
parent
31f8f35626
commit
4645195dd4
@ -29,19 +29,7 @@ class Company extends DataObject {
|
||||
|
||||
public static $summary_fields = array('Name', 'Category', 'Revenue', 'CEO');
|
||||
|
||||
|
||||
public function getCMSFields() {
|
||||
$fields = new FieldList();
|
||||
$fields->add(new TextField('Name', 'Name', $this->Name));
|
||||
$fields->add(new TextField('Category', 'Category', $this->Category));
|
||||
$fields->add(new TextField('Revenue', 'Revenue', $this->Revenue));
|
||||
$fields->add(new TextField('CEO', 'CEO', $this->CEO));
|
||||
if($this->ID !== 0){//existing
|
||||
$config = new GridFieldConfig_RelationEditor();
|
||||
$gridField = new GridField('Employees', 'Employees', $this->Employees(), $config);
|
||||
$fields->add($gridField);
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function requireDefaultRecords() {
|
||||
|
Loading…
Reference in New Issue
Block a user