You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
995B

  1. <?php
  2. namespace Lc\SovBundle\Controller\User;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  4. use Lc\SovBundle\Container\User\GroupUserContainer;
  5. use Lc\SovBundle\Controller\AbstractAdminController;
  6. use Lc\SovBundle\Factory\User\GroupUserFactory;
  7. use Lc\SovBundle\Field\StatusField;
  8. use Lc\SovBundle\Repository\RepositoryQueryInterface;
  9. abstract class GroupUserAdminController extends AbstractAdminController
  10. {
  11. public function getRepositoryQuery(): RepositoryQueryInterface
  12. {
  13. return $this->get(GroupUserContainer::class)->getRepositoryQuery();
  14. }
  15. public function configureFields(string $pageName): iterable
  16. {
  17. return [
  18. TextField::new('title')->setSortable(true),
  19. TextField::new('devAlias')->hideOnIndex(),
  20. StatusField::new('status')->setSortable(true),
  21. ];
  22. }
  23. public function createEntity(string $entityFqcn)
  24. {
  25. return $this->get(GroupUserContainer::class)->getFactory()->create();
  26. }
  27. }