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

39 lines
916 B
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\ORM\Tests\DataObjectTest;
use SilverStripe\Dev\TestOnly;
class SubTeam extends Team implements TestOnly
{
private static $table_name = 'DataObjectTest_SubTeam';
2016-10-14 03:30:05 +02:00
private static $db = [
'SubclassDatabaseField' => 'Varchar',
'SubclassFieldWithOverride' => 'Varchar',
];
2016-10-14 03:30:05 +02:00
private static $has_one = [
"ParentTeam" => Team::class,
];
2016-10-14 03:30:05 +02:00
private static $many_many = [
'FormerPlayers' => Player::class
];
2016-10-14 03:30:05 +02:00
private static $many_many_extraFields = [
'FormerPlayers' => [
'Position' => 'Varchar(100)'
]
];
/**
* Override the value of SubclassFieldWithOverride
* @return string Suffixes " (override)" to SubclassFieldWithOverride value
*/
public function getSubclassFieldWithOverride()
{
return $this->getField('SubclassFieldWithOverride') . ' (override)';
}
2016-10-14 03:30:05 +02:00
}