silverstripe-framework/tests/php/Dev/Validation/Hat.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

44 lines
785 B
PHP

<?php
namespace SilverStripe\Dev\Tests\Validation;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ManyManyList;
/**
* Class Hat
*
* @property string $Title
* @method Member Hatter()
* @method ManyManyList|Team[] TeamHats()
*/
class Hat extends DataObject implements TestOnly
{
/**
* @var string
*/
private static $table_name = 'RelationValidationTest_Hat';
/**
* @var array
*/
private static $db = [
'Title' => 'Varchar(255)',
];
/**
* @var array
*/
private static $belongs_to = [
'Hatter' => Member::class . '.Hat',
];
/**
* @var array
*/
private static $belongs_many_many = [
'TeamHats' => Team::class . '.ReserveHats',
];
}