Last active
November 5, 2018 23:10
-
-
Save maxime-rainville/9f544d1858b761db323c209933fd038c to your computer and use it in GitHub Desktop.
Example that breaks `GridFieldConfig_RelationEditor`
This file contains hidden or 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
<?php | |
use SilverStripe\ORM\DataObject; | |
class Dummy extends DataObject { | |
private static $db = [ | |
'Title' => 'Varchar', | |
]; | |
private static $many_many = [ | |
'SubDummies' => SubDummy::class | |
]; | |
private static $table_name = 'Dummy'; | |
} |
This file contains hidden or 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
<?php | |
use SilverStripe\Admin\ModelAdmin; | |
class DummyAdmin extends ModelAdmin { | |
private static $url_segment = 'dummy'; | |
private static $managed_models = [ | |
Dummy::class, | |
SubDummy::class, | |
]; | |
} |
This file contains hidden or 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
<?php | |
use SilverStripe\ORM\DataObject; | |
use SilverStripe\ORM\Filters\PartialMatchFilter; | |
class SubDummy extends DataObject { | |
private static $db = [ | |
'Title' => 'Varchar', | |
'Category' => 'Varchar', | |
]; | |
private static $belongs_many_many = [ | |
'Dummies' => Dummy::class | |
]; | |
private static $table_name = 'SubDummy'; | |
private static $searchable_fields = [ | |
'Title' => [ | |
'title' => 'Title (partial)', | |
'filter' => PartialMatchFilter::class, | |
] | |
]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment