-
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.
ENH: Update reorderItems() to use ORM where possible (#336)
* ENH: Update reorderItems() to use ORM where possible * Increase test coverage of orderable rows
- Loading branch information
1 parent
7a8f244
commit 23a5154
Showing
8 changed files
with
181 additions
and
40 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
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,25 @@ | ||
<?php | ||
|
||
namespace Symbiote\GridFieldExtensions\Tests\Stub; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
use SilverStripe\ORM\ManyManyList; | ||
use SilverStripe\Versioned\Versioned; | ||
|
||
/** | ||
* @method ManyManyList|ThroughDefinerVersioned[] Definers() | ||
* @mixin Versioned | ||
*/ | ||
class ThroughBelongsVersioned extends DataObject implements TestOnly | ||
{ | ||
private static string $table_name = 'ThroughBelongsVersioned'; | ||
|
||
private static array $belongs_many_many = [ | ||
'Definers' => ThroughDefinerVersioned::class, | ||
]; | ||
|
||
private static array $extensions = [ | ||
Versioned::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,33 @@ | ||
<?php | ||
|
||
namespace Symbiote\GridFieldExtensions\Tests\Stub; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
use SilverStripe\ORM\ManyManyThroughList; | ||
use SilverStripe\Versioned\Versioned; | ||
|
||
/** | ||
* @method ManyManyThroughList|ThroughIntermediaryVersioned Belongings() | ||
* @mixin Versioned | ||
*/ | ||
class ThroughDefinerVersioned extends DataObject implements TestOnly | ||
{ | ||
private static string $table_name = 'ThroughDefinerVersioned'; | ||
|
||
private static array $many_many = [ | ||
'Belongings' => [ | ||
'through' => ThroughIntermediaryVersioned::class, | ||
'from' => 'Defining', | ||
'to' => 'Belonging', | ||
] | ||
]; | ||
|
||
private static array $owns = [ | ||
'Belongings' | ||
]; | ||
|
||
private static array $extensions = [ | ||
Versioned::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,32 @@ | ||
<?php | ||
|
||
namespace Symbiote\GridFieldExtensions\Tests\Stub; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
use SilverStripe\Versioned\Versioned; | ||
|
||
/** | ||
* @property int $DefiningID | ||
* @property int $BelongingID | ||
* @method ThroughDefinerVersioned Defining() | ||
* @method ThroughBelongsVersioned Belonging() | ||
* @mixin Versioned | ||
*/ | ||
class ThroughIntermediaryVersioned extends DataObject implements TestOnly | ||
{ | ||
private static string $table_name = 'ThroughIntermediaryVersioned'; | ||
|
||
private static array $db = [ | ||
'Sort' => 'Int', | ||
]; | ||
|
||
private static array $has_one = [ | ||
'Defining' => ThroughDefinerVersioned::class, | ||
'Belonging' => ThroughBelongsVersioned::class, | ||
]; | ||
|
||
private static array $extensions = [ | ||
Versioned::class, | ||
]; | ||
} |