2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\DataExtensionTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\Forms\TextField;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for CMS fields
|
|
|
|
*/
|
|
|
|
class CMSFieldsBase extends DataObject implements TestOnly
|
|
|
|
{
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $table_name = 'DataExtensionTest_CMSFieldsBase';
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $db = array(
|
|
|
|
'PageField' => 'Varchar(255)'
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $extensions = array(
|
|
|
|
CMSFieldsBaseExtension::class
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function getCMSFields()
|
|
|
|
{
|
|
|
|
$fields = parent::getCMSFields();
|
|
|
|
$fields->addFieldToTab('Root.Test', new TextField('PageField'));
|
|
|
|
return $fields;
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|