Created
May 12, 2022 23:46
-
-
Save muskie9/107df3a689468866da1340c6af1bb4a2 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace My\Custom\Namespace; | |
class MyAdmin extends ModelAdmin | |
{ | |
private static $managed_models = [ | |
'myModelKey' => [ | |
'dataClass' => MyClass::class, | |
'title' => 'My Class Title', | |
], | |
'myOtherModelKey' => [ | |
'dataClass' => MyOtherClass::class, | |
'title' => 'My Other Class Title', | |
], | |
]; | |
/** | |
* @return DataList | |
*/ | |
public function getList() | |
{ | |
$list = parent::getList(); | |
if ($this->modelTab === 'myModelKey') { | |
$list = $list->filter([ | |
'ClassName' => MyClass::class, | |
]); | |
} | |
return $list; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment