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