silverstripe-framework/tests/php/ORM/DataExtensionTest/CMSFieldsBase.php
2020-04-20 18:58:09 +01:00

32 lines
669 B
PHP

<?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
{
private static $table_name = 'DataExtensionTest_CMSFieldsBase';
private static $db = [
'PageField' => 'Varchar(255)'
];
private static $extensions = [
CMSFieldsBaseExtension::class
];
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Test', new TextField('PageField'));
return $fields;
}
}