2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Forms\Tests\GridField\GridFieldDetailFormTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\Forms\GridField\GridField;
|
|
|
|
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
|
|
|
|
class PeopleGroup extends DataObject implements TestOnly
|
|
|
|
{
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $table_name = 'GridFieldDetailFormTest_PeopleGroup';
|
|
|
|
|
|
|
|
private static $db = array(
|
|
|
|
'Name' => 'Varchar'
|
|
|
|
);
|
|
|
|
|
|
|
|
private static $has_many = array(
|
|
|
|
'People' => Person::class
|
|
|
|
);
|
|
|
|
|
|
|
|
private static $belongs_many_many = array(
|
|
|
|
'FavouritePeople' => Person::class
|
|
|
|
);
|
|
|
|
|
|
|
|
private static $default_sort = '"Name"';
|
|
|
|
|
|
|
|
public function getCMSFields()
|
|
|
|
{
|
|
|
|
$fields = parent::getCMSFields();
|
|
|
|
// TODO No longer necessary once FormScaffolder uses GridField
|
|
|
|
$fields->replaceField(
|
|
|
|
'People',
|
|
|
|
GridField::create(
|
|
|
|
'People',
|
|
|
|
'People',
|
|
|
|
$this->People(),
|
|
|
|
GridFieldConfig_RelationEditor::create()
|
|
|
|
)
|
|
|
|
);
|
|
|
|
return $fields;
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|