2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\UnsavedRelationListTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
use SilverStripe\ORM\HasManyList;
|
|
|
|
use SilverStripe\ORM\ManyManyList;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @method HasManyList RelatedObjects()
|
|
|
|
* @method HasManyList Children()
|
|
|
|
* @method ManyManyList Siblings()
|
|
|
|
*/
|
|
|
|
class TestObject extends DataObject implements TestOnly
|
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $table_name = 'UnsavedRelationListTest_DataObject';
|
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $db = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'Name' => 'Varchar',
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $has_one = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'Parent' => TestObject::class,
|
|
|
|
'RelatedObject' => DataObject::class
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $has_many = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'Children' => 'SilverStripe\\ORM\\Tests\\UnsavedRelationListTest\\TestObject.Parent',
|
|
|
|
'RelatedObjects' => 'SilverStripe\\ORM\\Tests\\UnsavedRelationListTest\\TestObject.RelatedObject'
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $many_many = [
|
2016-12-16 05:34:21 +01:00
|
|
|
'Siblings' => TestObject::class,
|
2020-04-20 19:58:09 +02:00
|
|
|
];
|
2016-12-16 05:34:21 +01:00
|
|
|
|
2020-04-20 19:58:09 +02:00
|
|
|
private static $many_many_extraFields = [
|
|
|
|
'Siblings' => [
|
2016-12-16 05:34:21 +01:00
|
|
|
'Number' => 'Int',
|
2020-04-20 19:58:09 +02:00
|
|
|
],
|
|
|
|
];
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|