2016-10-14 14:30:05 +13:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\DataObjectTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
2019-05-06 12:33:23 +12:00
|
|
|
use SilverStripe\ORM\FieldType\DBVarchar;
|
2016-10-14 14:30:05 +13:00
|
|
|
|
|
|
|
class Fan extends DataObject implements TestOnly
|
|
|
|
{
|
2016-12-16 17:34:21 +13:00
|
|
|
private static $table_name = 'DataObjectTest_Fan';
|
2016-10-14 14:30:05 +13:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
private static $db = array(
|
|
|
|
'Name' => 'Varchar(255)',
|
2019-05-06 12:33:23 +12:00
|
|
|
'Email' => DBVarchar::class
|
2016-12-16 17:34:21 +13:00
|
|
|
);
|
2016-10-14 14:30:05 +13:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
private static $has_one = array(
|
|
|
|
'Favourite' => DataObject::class, // Polymorphic relation
|
|
|
|
'SecondFavourite' => DataObject::class
|
|
|
|
);
|
2016-10-14 14:30:05 +13:00
|
|
|
}
|