# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:

services:
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

    # makes classes in src/ available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

    # controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

    App\Service\SecurityVoter:
            arguments:
                - "@controller_resolver"
                - "@doctrine.orm.default_entity_manager"
                - "@security.token_storage"
            tags: ['security.voter']


    security_voter:
        alias: App\Service\SecurityVoter

    OldSound\RabbitMqBundle\RabbitMq\ProducerInterface: '@old_sound_rabbit_mq.task_producer'

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones


    admin.user:
        class: App\Admin\UserAdmin
        arguments: [~, App\Entity\User, App\Controller\UserAdminController]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Users, label: User }
        public: true

    admin.role:
        class: App\Admin\RoleAdmin
        arguments: [~, App\Entity\Role, App\Controller\RoleAdminController]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Users, label: Role }
        public: true

    admin.action:
        class: App\Admin\ActionAdmin
        arguments: [~, App\Entity\Action, App\Controller\ActionAdminController]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Users, label: Action }
        public: true

    admin.slot:
        class: App\Admin\SlotAdmin
        arguments: [ ~, App\Entity\Slot, App\Controller\SlotAdminController ]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: Slot }
        public: true

    admin.content:
        class: App\Admin\ContentAdmin
        arguments: [ ~, App\Entity\Content, App\Controller\ContentAdminController ]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: Content }
        public: true

    admin.slide:
        class: App\Admin\SlideAdmin
        arguments: [ ~, App\Entity\Slide, App\Controller\SlideAdminController ]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: Slide }
        public: true

    admin.menu:
        class: App\Admin\MenuAdmin
        arguments: [ ~, App\Entity\Menu, App\Controller\MenuAdminController ]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: Menu }
        public: true

    admin.menu_item:
        class: App\Admin\MenuItemAdmin
        arguments: [ ~, App\Entity\MenuItem, App\Controller\MenuItemAdminController ]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: MenuItem, show_in_dashboard: false }
        public: true

    admin.gallery:
        class: App\Admin\GalleryAdmin
        arguments: [~, App\Entity\Gallery, App\Controller\GalleryAdminController]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: Gallery }
        public: true

    admin.gallery_item:
        class: App\Admin\GalleryItemAdmin
        arguments: [~, App\Entity\GalleryItem, App\Controller\GalleryItemAdminController]
        tags:
            - { name: sonata.admin, manager_type: orm, group: Site, label: GalleryItem }
        public: true
