-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX GridFieldOrderableRows to support polymorphic ManyManyThroughList
- Loading branch information
1 parent
a710c81
commit 9944b67
Showing
6 changed files
with
147 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MParent: | ||
ParentOne: | ||
ParentTwo: | ||
|
||
Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MChild: | ||
ChildOne: | ||
ChildTwo: | ||
|
||
Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MMapper: | ||
MapP1ToC1: | ||
Parent: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MParent.ParentOne' | ||
Child: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MChild.ChildOne' | ||
Sort: 1 | ||
|
||
MapP1ToC2: | ||
Parent: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MParent.ParentOne' | ||
Child: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MChild.ChildTwo' | ||
Sort: 2 | ||
|
||
MapP2ToC1: | ||
Parent: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MParent.ParentTwo' | ||
Child: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MChild.ChildOne' | ||
Sort: 2 | ||
|
||
MapP2ToC2: | ||
Parent: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MParent.ParentTwo' | ||
Child: '=>Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MChild.ChildTwo' | ||
Sort: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Symbiote\GridFieldExtensions\Tests\Stub; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class PolymorphM2MChild extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'TestOnly_PolymorphM2MChild'; | ||
|
||
private static $has_many = [ | ||
'Parents' => PolymorphM2MMapper::class | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Symbiote\GridFieldExtensions\Tests\Stub; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class PolymorphM2MMapper extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'TestOnly_PolymorphM2MMapper'; | ||
|
||
private static $db = [ | ||
'Sort' => 'Int' | ||
]; | ||
|
||
private static $has_one = [ | ||
'Parent' => DataObject::class, // PolymorphM2MParent | ||
'Child' => PolymorphM2MChild::class, | ||
]; | ||
|
||
private static $default_sort = '"Sort" ASC'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Symbiote\GridFieldExtensions\Tests\Stub; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class PolymorphM2MParent extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'TableOnly_PolymorphM2MParent'; | ||
|
||
private static $many_many = [ | ||
'Children' => [ | ||
'through' => PolymorphM2MMapper::class, | ||
'from' => 'Parent', | ||
'to' => 'Child', | ||
] | ||
]; | ||
} |