1
|
|
|
<?php
|
2
|
|
|
|
3
|
|
|
namespace SilverLeague\IDEAnnotator\Tests;
|
4
|
|
|
|
5
|
|
|
use SilverStripe\Core\Config\Config;
|
6
|
|
|
use SilverStripe\ORM\DataObject;
|
7
|
|
|
use SilverStripe\Dev\TestOnly;
|
8
|
|
|
|
9
|
|
|
/**
|
10
|
|
|
* Class DataObjectAnnotatorTest_Team
|
11
|
|
|
*
|
12
|
|
|
* @author Simon
|
13
|
|
|
* @property string $Title The Team Name
|
14
|
|
|
* @property int $VisitCount
|
15
|
|
|
* @property string $ExtendedVarcharField
|
16
|
|
|
* @property int $ExtendedIntField
|
17
|
|
|
* @property int $CaptainID
|
18
|
|
|
* @property int $HasOneRelationshipID
|
19
|
|
|
* @property int $ExtendedHasOneRelationshipID
|
20
|
|
|
* @method \SilverLeague\IDEAnnotator\Tests\Player Captain() This is the Boss
|
21
|
|
|
* @method \SilverLeague\IDEAnnotator\Tests\Player HasOneRelationship()
|
22
|
|
|
* @method \SilverLeague\IDEAnnotator\Tests\Player ExtendedHasOneRelationship()
|
23
|
|
|
* @method \SilverStripe\ORM\DataList|\SilverLeague\IDEAnnotator\Tests\SubTeam[] SubTeams()
|
24
|
|
|
* @method \SilverStripe\ORM\DataList|DataObjectAnnotatorTest_TeamComment[] Comments()
|
25
|
|
|
* @method \SilverStripe\ORM\ManyManyList|\SilverLeague\IDEAnnotator\Tests\Player[] Players()
|
26
|
|
|
* @mixin \SilverLeague\IDEAnnotator\Tests\Team_Extension This adds extra methods
|
27
|
|
|
*/
|
28
|
|
|
class TeamChanged extends DataObject implements TestOnly
|
29
|
|
|
{
|
30
|
|
|
|
31
|
|
|
private static $db = [
|
32
|
|
|
'Title' => 'Varchar',
|
33
|
|
|
'Price' => 'Currency'
|
34
|
|
|
];
|
35
|
|
|
|
36
|
|
|
private static $has_one = [
|
37
|
|
|
"Captain" => Player::class,
|
38
|
|
|
'HasOneRelationship' => Player::class,
|
39
|
|
|
];
|
40
|
|
|
|
41
|
|
|
private static $has_many = [
|
42
|
|
|
'SubTeams' => SubTeam::class,
|
43
|
|
|
'Comments' => TeamComment::class
|
44
|
|
|
];
|
45
|
|
|
|
46
|
|
|
private static $many_many = [
|
47
|
|
|
'Players' => Player::class,
|
48
|
|
|
'SecondarySubTeams' => SubTeam::class,
|
49
|
|
|
];
|
50
|
|
|
|
51
|
|
|
public function SecondarySubTeams()
|
52
|
|
|
{
|
53
|
|
|
|
54
|
|
|
}
|
55
|
|
|
}
|
56
|
|
|
|