silverstripe-framework/tests/php/ORM/DataExtensionTest/CMSFieldsBase.php
2016-11-23 19:25:12 +13:00

32 lines
625 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 = array(
'PageField' => 'Varchar(255)'
);
private static $extensions = array(
CMSFieldsBaseExtension::class
);
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Test', new TextField('PageField'));
return $fields;
}
}