MINOR Relying on field scaffolding in Company (now that FormScaffolder uses GridField)

This commit is contained in:
Ingo Schommer 2012-03-14 17:20:03 +01:00
parent 31f8f35626
commit 4645195dd4

View File

@ -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() {