PHP | Problem -
<?php
class Episode extends DataObject {
static $db = array(
'Title' => 'Text',
'Number' => 'Decimal',
'Date' => 'Date',
'Notes' => 'HTMLText'
);
static $has_one =array(
'Show' => 'ShowPage',
'Image' => 'Image'
);
static $many_many =array(
'Hosts' => 'Person'
);
static $belongs_many_many = array(
);
function getCMSFields() {
$f = new FieldList();
$f->push( new TextField('Title'));
$f->push( new TextField('Number', 'Episode Number'));
$f->push( new DateField('Date'));
$f->push( new HTMLEditorField('Notes', 'Show Notes'));
$f->push( new UploadField('Image'));
$PersonGridConfig = GridFieldConfig_RelationEditor::create();
$PersonGrid = new GridField('Hosts','Show Hosts', $this->Hosts(), $PersonGridConfig) ;
$f->push( new $PersonGrid);
return $f;
}
}