doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'

        # IMPORTANT: You MUST configure your server version,
        # either here or in the DATABASE_URL env var (see .env file)
        #server_version: '16'

        profiling_collect_backtrace: '%kernel.debug%'
        use_savepoints: true
    orm:
        auto_generate_proxy_classes: true
        enable_lazy_ghost_objects: true
        report_fields_where_declared: true
        validate_xml_mapping: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        mappings:
            App:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
                alias: App
            AppBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/AppBundle/Entity'
                prefix: 'App\Bundle\AppBundle\Entity'
                alias: AppBundle
            AdminBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/AdminBundle/Entity'
                prefix: 'App\Bundle\AdminBundle\Entity'
                alias: AdminBundle
            EmployeeBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/EmployeeBundle/Entity'
                prefix: 'App\Bundle\EmployeeBundle\Entity'
                alias: EmployeeBundle
            ContractBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/ContractBundle/Entity'
                prefix: 'App\Bundle\ContractBundle\Entity'
                alias: ContractBundle
            DocumentTemplateBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/DocumentTemplateBundle/Entity'
                prefix: 'App\Bundle\DocumentTemplateBundle\Entity'
                alias: DocumentTemplateBundle
            SignatureBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/SignatureBundle/Entity'
                prefix: 'App\Bundle\SignatureBundle\Entity'
                alias: SignatureBundle
            LeaveBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/LeaveBundle/Entity'
                prefix: 'App\Bundle\LeaveBundle\Entity'
                alias: LeaveBundle
            PlanningBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/PlanningBundle/Entity'
                prefix: 'App\Bundle\PlanningBundle\Entity'
                alias: PlanningBundle
            TimeClockBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/TimeClockBundle/Entity'
                prefix: 'App\Bundle\TimeClockBundle\Entity'
                alias: TimeClockBundle
            InterviewBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/InterviewBundle/Entity'
                prefix: 'App\Bundle\InterviewBundle\Entity'
                alias: InterviewBundle
            MedicalVisitBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/MedicalVisitBundle/Entity'
                prefix: 'App\Bundle\MedicalVisitBundle\Entity'
                alias: MedicalVisitBundle
            SickLeaveBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/SickLeaveBundle/Entity'
                prefix: 'App\Bundle\SickLeaveBundle\Entity'
                alias: SickLeaveBundle
            EmailBundle:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Bundles/EmailBundle/Entity'
                prefix: 'App\Bundle\EmailBundle\Entity'
                alias: EmailBundle

when@test:
    doctrine:
        dbal:
            # "TEST_TOKEN" is typically set by ParaTest
            dbname_suffix: '_test%env(default::TEST_TOKEN)%'

when@prod:
    doctrine:
        orm:
            auto_generate_proxy_classes: false
            proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
            query_cache_driver:
                type: pool
                pool: doctrine.system_cache_pool
            result_cache_driver:
                type: pool
                pool: doctrine.result_cache_pool

    framework:
        cache:
            pools:
                doctrine.result_cache_pool:
                    adapter: cache.app
                doctrine.system_cache_pool:
                    adapter: cache.system
