silverstripe-framework/tests/php/Dev/Validation/Member.php
Mojmir Fendek 89c87ddbf8
NEW: Static validation for relationships. (#9874)
* NEW: Static validation for relationships.

* Unit tests added.

* PR fixes

* PR feedback: Execute validation on flush.

* PR fixes.

* PR fixes.
2022-02-04 14:41:09 +13:00

55 lines
1.1 KiB
PHP

<?php
namespace SilverStripe\Dev\Tests\Validation;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\HasManyList;
use SilverStripe\ORM\ManyManyThroughList;
/**
* Class Member
*
* @property string $Title
* @method Team HomeTeam()
* @method Hat Hat()
* @method HasManyList|Freelancer[] TemporaryMembers()
* @method ManyManyThroughList|Member[] FreelancerTeams()
*/
class Member extends DataObject implements TestOnly
{
/**
* @var string
*/
private static $table_name = 'RelationValidationTest_Member';
/**
* @var array
*/
private static $db = [
'Title' => 'Varchar(255)',
];
/**
* @var array
*/
private static $has_one = [
'HomeTeam' => Team::class,
'Hat' => Hat::class,
];
/**
* @var array
*/
private static $has_many = [
'TemporaryMembers' => Freelancer::class . '.TemporaryMember',
];
/**
* @var array
*/
private static $belongs_many_many = [
'FreelancerTeams' => Team::class . '.Freelancers',
];
}