silverstripe-framework/tests/php/ORM/DataDifferencerTest/TestObject.php

47 lines
1.1 KiB
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\ORM\Tests\DataDifferencerTest;
use SilverStripe\Assets\Image;
use SilverStripe\Dev\TestOnly;
use SilverStripe\Forms\ListboxField;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Versioning\Versioned;
/**
* @property string $Choices
* @method Image Image()
* @method HasOneRelationObject HasOneRelation()
*/
class TestObject extends DataObject implements TestOnly
{
private static $table_name = 'DataDifferencerTest_Object';
private static $extensions = array(
Versioned::class
);
private static $db = array(
'Choices' => "Varchar",
);
private static $has_one = array(
'Image' => Image::class,
'HasOneRelation' => HasOneRelationObject::class
);
public function getCMSFields()
{
$fields = parent::getCMSFields();
$choices = array(
'a' => 'a',
'b' => 'b',
'c' => 'c',
);
$listField = new ListboxField('Choices', 'Choices', $choices);
$fields->push($listField);
return $fields;
}
2016-10-14 03:30:05 +02:00
}