services:
    _defaults:
        autowire: true
        autoconfigure: true

    AutoAdmin\Bundle\BrickBuilder\Brick\BrickHandlerManagerInterface:
        public: true
        class: 'AutoAdmin\Bundle\BrickBuilder\Brick\BrickHandlerManager'
        arguments:
            - null
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickConfigManager'
            - '@translator'
            - '@form.factory'
            - '@kernel'

    AutoAdmin\Bundle\BrickBuilder\Brick\BrickRendererInterface:
        public: true
        class: 'AutoAdmin\Bundle\BrickBuilder\Brick\BrickRenderer'
        arguments:
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickHandlerManagerInterface'
            - '@doctrine'
            - '%kernel.environment%'

    AutoAdmin\Bundle\BrickBuilder\Brick\BrickTextRenderer:
        parent: AutoAdmin\Bundle\BrickBuilder\Brick\BrickRendererInterface

    AutoAdmin\Bundle\BrickBuilder\Twig\Extension\BrickExtension:
        arguments:
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickRendererInterface'
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickHandlerManagerInterface'
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickAdminHelper'
        tags:
            - 'twig.extension'

    AutoAdmin\Bundle\BrickBuilder\Builder\BuilderService: ~

    AutoAdmin\Bundle\BrickBuilder\Controller\Admin\ContentBuilderController:
        tags:
            - 'aa_admin.controller'

    AutoAdmin\Bundle\BrickBuilder\Brick\BrickAdminHelper:
        arguments:
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickHandlerManagerInterface'
            - '@translator'

    AutoAdmin\Bundle\BrickBuilder\Serializer\BrickNormalizer:
        tags:
            - 'serializer.normalizer'
        arguments:
            - '@Symfony\Component\Serializer\Normalizer\ObjectNormalizer'
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickAdminHelper'

    AutoAdmin\Bundle\BrickBuilder\Doctrine\EventListener\BrickListener:
        tags:
            #            - { name: 'doctrine.event_subscriber', connection: 'default' }
            - { name: 'doctrine.event_listener', event: 'postLoad', priority: 0 }
            - { name: 'doctrine.event_listener', event: 'prePersist', priority: 0 }
            - { name: 'doctrine.event_listener', event: 'preUpdate', priority: 0 }
            - { name: 'doctrine.event_listener', event: 'postUpdate', priority: 0 }
            - { name: 'doctrine.event_listener', event: 'postPersist', priority: 0 }

    AutoAdmin\Bundle\BrickBuilder\Brick\BrickConfigManager:
        public: true
        arguments:
            - '@AutoAdmin\Bundle\BrickBuilder\Brick\BrickHandlerManagerInterface'

    AutoAdmin\Bundle\BrickBuilder\Repository\BrickRepository:
        arguments:
            - '@Doctrine\Persistence\ManagerRegistry'
        tags:
            - 'doctrine.repository_service'

    AutoAdmin\Bundle\BrickBuilder\Command\CreateBrickHandlerCommand:
        arguments:
            - '@service_container'
            - '@filesystem'
        tags: [ 'console.command' ]

    AutoAdmin\Bundle\BrickBuilder\Helper\BrickResolver:
        arguments:
            - '@Doctrine\ORM\EntityManagerInterface'
            - '@AutoAdmin\Bundle\Admin\Configuration\ConfigManager'
            - '@AutoAdmin\Bundle\Content\Site\SiteContextHelper'

    AutoAdmin\Bundle\BrickBuilder\Command\BrickResolveCommand:
        arguments:
            - '@AutoAdmin\Bundle\BrickBuilder\Helper\BrickResolver'
            - '@AutoAdmin\Bundle\Admin\Router\AdminRouter'
            - '@AutoAdmin\Bundle\Content\Site\SiteContextHelper'
        tags: [ 'console.command' ]

    AutoAdmin\Bundle\BrickBuilder\Helper\DatabaseBrickFormat: ~

    AutoAdmin\Bundle\BrickBuilder\Service\BrickService: ~
