sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Create a TaggedAdminTrait instead of the AbstractTaggedAdmin and move AbstractAdmin construct arguments to the sonata.admin tag #6723

Closed VincentLanglet closed 2 years ago

VincentLanglet commented 3 years ago

The sonata.admin tag requires

The AbstractTaggedAdmin class has all these setters and the constructor signature. If we could stop to rely on the constructor signature, we could stop using the AbstractTaggedAdmin class and use a trait with all the getters/setters instead.

For this, we should move from this admin declaration

admin.category:
    class: App\Admin\CategoryAdmin
    arguments: [CustomCode, App\Entity\Category, CustomController::class]
    tags:
        - { name: sonata.admin, manager_type: orm, label: Category }

To this one

admin.category:
    class: App\Admin\CategoryAdmin
    tags:
        - { name: sonata.admin, class: App\Entity\Category, controller: CustomController::class, code: CustomCode, manager_type: orm, label: Category }
github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.