2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\DataObjectTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\Tests\DataObjectTest;
|
|
|
|
use SilverStripe\Security\Member;
|
|
|
|
|
|
|
|
class Player extends Member implements TestOnly
|
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $table_name = 'DataObjectTest_Player';
|
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $db = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'IsRetired' => 'Boolean',
|
|
|
|
'ShirtNumber' => 'Varchar',
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $has_one = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'FavouriteTeam' => DataObjectTest\Team::class,
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $belongs_many_many = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'Teams' => DataObjectTest\Team::class
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $has_many = [
|
2018-01-16 19:39:30 +01:00
|
|
|
'Fans' => Fan::class . '.Favourite', // Polymorphic - Player fans
|
|
|
|
'CaptainTeams' => Team::class . '.Captain',
|
|
|
|
'FoundingTeams' => Team::class . '.Founder'
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $belongs_to = [
|
2018-01-16 19:39:30 +01:00
|
|
|
'CompanyOwned' => Company::class . '.Owner'
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $searchable_fields = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'IsRetired',
|
|
|
|
'ShirtNumber'
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2023-07-24 06:10:47 +02:00
|
|
|
|
|
|
|
public function ReturnsNull()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|