mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
7086f2ea3a
* BUGFIX many many through not sorting by join table * #8534 added docs to support many many sorting fix * #8534 added test cases for many_many default sorting
37 lines
858 B
PHP
37 lines
858 B
PHP
<?php
|
|
|
|
namespace SilverStripe\ORM\Tests\ManyManyThroughListTest;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
class Locale extends DataObject implements TestOnly
|
|
{
|
|
private static $table_name = 'ManyManyThroughTest_Locale';
|
|
|
|
/**
|
|
* @config
|
|
* @var array
|
|
*/
|
|
private static $db = [
|
|
'Title' => 'Varchar(100)',
|
|
'Locale' => 'Varchar(10)',
|
|
'URLSegment' => 'Varchar(100)',
|
|
'IsGlobalDefault' => 'Boolean',
|
|
];
|
|
|
|
private static $has_many = [
|
|
'FallbackLocales' => FallbackLocale::class . '.Parent',
|
|
];
|
|
|
|
private static $many_many = [
|
|
'Fallbacks' => [
|
|
'through' => FallbackLocale::class,
|
|
'from' => 'Parent',
|
|
'to' => 'Locale',
|
|
],
|
|
];
|
|
|
|
private static $default_sort = '"ManyManyThroughTest_Locale"."Locale" ASC';
|
|
}
|