silverstripe-framework/tests/php/ORM/DataObjectTest/Player.php

41 lines
1009 B
PHP
Raw Normal View History

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
{
private static $table_name = 'DataObjectTest_Player';
private static $db = array(
'IsRetired' => 'Boolean',
'ShirtNumber' => 'Varchar',
);
private static $has_one = array(
'FavouriteTeam' => DataObjectTest\Team::class,
);
private static $belongs_many_many = array(
'Teams' => DataObjectTest\Team::class
);
private static $has_many = array(
2018-01-16 19:39:30 +01:00
'Fans' => Fan::class . '.Favourite', // Polymorphic - Player fans
'CaptainTeams' => Team::class . '.Captain',
'FoundingTeams' => Team::class . '.Founder'
);
private static $belongs_to = array(
2018-01-16 19:39:30 +01:00
'CompanyOwned' => Company::class . '.Owner'
);
private static $searchable_fields = array(
'IsRetired',
'ShirtNumber'
);
2016-10-14 03:30:05 +02:00
}