silverstripe-framework/tests/php/ORM/DataExtensionTest/CMSFieldsBase.php

32 lines
669 B
PHP
Raw Normal View History

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