services:
    _defaults:
        public: true

    _instanceof:
        Contao\CoreBundle\Framework\FrameworkAwareInterface:
            calls:
                - ["setFramework", ["@contao.framework"]]

    Codefog\NewsCategoriesBundle\NewsCategoriesManager: '@codefog_news_categories.manager'

    codefog_news_categories.manager:
        class: Codefog\NewsCategoriesBundle\NewsCategoriesManager

    codefog_news_categories.picker:
        class: Codefog\NewsCategoriesBundle\Picker\NewsCategoriesPickerProvider
        public: false
        arguments:
            - "@knp_menu.factory"
            - "@router"
        calls:
            - [setTokenStorage, ["@security.token_storage"]]
            - [setPermissionChecker, ["@codefog_news_categories.permission_checker"]]
        tags:
            - { name: contao.picker_provider, priority: 132 }

    codefog_news_categories.permission_checker:
        class: Codefog\NewsCategoriesBundle\PermissionChecker
        public: false
        arguments:
            - "@database_connection"
            - "@security.token_storage"

    codefog_news_categories.news_criteria_builder:
        class: Codefog\NewsCategoriesBundle\Criteria\NewsCriteriaBuilder
        arguments:
            - "@database_connection"
            - "@codefog_news_categories.manager"
