| 1 | <?php |
||
| 2 | |||
| 3 | namespace Dynamic\ManageableDataObject\Test\Model; |
||
| 4 | |||
| 5 | use Dynamic\ManageableDataObject\Extensions\ManageableControllerExtension; |
||
| 6 | use Dynamic\ManageableDataObject\Form\ManageableDataObjectForm; |
||
| 7 | use SilverStripe\Dev\TestOnly; |
||
| 8 | use SilverStripe\View\Requirements; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class SampleManageableObjectPageController |
||
| 12 | * @package Dynamic\ManageableDataObject\Test\Model |
||
| 13 | * |
||
| 14 | * @mixin ManageableControllerExtension |
||
| 15 | */ |
||
| 16 | class SampleManageableObjectPageController extends \PageController implements TestOnly |
||
| 17 | { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | private static $allowed_actions = [ |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 23 | 'Form', |
||
| 24 | ]; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | private static $extensions = [ |
||
|
0 ignored issues
–
show
|
|||
| 30 | ManageableControllerExtension::class |
||
| 31 | ]; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | private static $managed_object = SampleManageableDataObject::class; |
||
|
0 ignored issues
–
show
|
|||
| 37 | |||
| 38 | /** |
||
| 39 | * |
||
| 40 | */ |
||
| 41 | public function init() |
||
| 42 | { |
||
| 43 | parent::init(); |
||
| 44 | Requirements::clear(); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function Form() |
||
| 48 | { |
||
| 49 | return ManageableDataObjectForm::create($this, 'Form', $this->config()->get('managed_object')); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |