silverstripe-framework/tests/php/ORM/ManyManyListTest/IndirectPrimary.php

34 lines
945 B
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\ORM\Tests\ManyManyListTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ManyManyList;
2016-10-14 03:30:05 +02:00
/**
* A data object that implements the primary side of a many_many (where the extra fields are
* defined.) The many-many refers to ManyManyListTest_Secondary rather than ManyManyListTest_SecondarySub
* by design, because we're trying to test that a subclass instance picks up the extra fields of it's parent.
*
* @method ManyManyList Secondary()
2016-10-14 03:30:05 +02:00
*/
class IndirectPrimary extends DataObject implements TestOnly
{
private static $table_name = 'ManyManyListTest_IndirectPrimary';
2016-10-14 03:30:05 +02:00
private static $db = array(
'Title' => 'Varchar(255)'
);
2016-10-14 03:30:05 +02:00
private static $many_many = array(
'Secondary' => Secondary::class
);
2016-10-14 03:30:05 +02:00
private static $many_many_extraFields = array(
'Secondary' => array(
'DocumentSort' => 'Int'
)
);
2016-10-14 03:30:05 +02:00
}