parameters:
    # Adds a fallback DATABASE_URL if the env var is not set.
    # This allows you to run cache:warmup even if your
    # environment variables are not available yet.
    # You should not need to change this value.
    env(DATABASE_URL): ''

doctrine:
    dbal:
        # configure these for your database server
        driver: 'pdo_mysql'
        charset: utf8
        default_table_options:
            charset: utf8
            collate: utf8_general_ci
        url: '%env(resolve:DATABASE_URL)%'
        types:
            json: Sonata\Doctrine\Types\JsonType
            uuid: Ramsey\Uuid\Doctrine\UuidType
            uuid_binary:  Ramsey\Uuid\Doctrine\UuidBinaryType
            uuid_binary_ordered_time: Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType
            personal_data:  SpecShaper\GdprBundle\Types\PersonalDataType
        mapping_types:
            uuid_binary: binary
            uuid_binary_ordered_time: binary
            enum: string

        # IMPORTANT: You MUST configure your server version,
        # either here or in the DATABASE_URL env var (see .env file)
        #server_version: '13'
        # only needed for MySQL
        # charset: utf8mb4
        # default_table_options:
        #     collate: utf8mb4_unicode_ci
        # backtrace queries in profiler (increases memory usage per request)
        #profiling_collect_backtrace: '%kernel.debug%'

    orm:
        # Note: resolve_target_entities for MenuInterface/MenuItemInterface no longer needed
        # The new MenuBundle uses concrete classes directly (no interfaces)
        auto_generate_proxy_classes: '%kernel.debug%'
        entity_managers:
            default:
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: true
                # Désactiver le cache métadonnées en dev pour forcer resolve_target_entity
                metadata_cache_driver:
                    type: array
                mappings:
                    ApplicationSonataClassificationBundle: ~
                    SonataClassificationBundle: ~
                    ApplicationSonataMediaBundle: ~
                    SonataMediaBundle: ~
                    App:
                        is_bundle: false
                        type: annotation
                        dir: '%kernel.project_dir%/src/Entity'
                        prefix: 'App\Entity'
                        alias: App
                    MenuBundle:
                        is_bundle: false
                        type: annotation
                        dir: '%kernel.project_dir%/src/MenuBundle/Entity'
                        prefix: 'App\MenuBundle\Entity'
                        alias: MenuBundle
                    gedmo_loggable:
                        type: annotation
                        prefix: Gedmo\Loggable\Entity
                        dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Loggable/Entity"
                        alias: GedmoLoggable # (optional) it will default to the name set for the mapping
                        is_bundle: false
                dql:
                    string_functions:
                        str_to_date: App\DQL\StrToDate
                        MONTH: DoctrineExtensions\Query\Mysql\Month
                        YEAR: DoctrineExtensions\Query\Mysql\Year
                    numeric_functions:
                        acos: DoctrineExtensions\Query\Mysql\Acos
                        cos: DoctrineExtensions\Query\Mysql\Cos
                        radians: DoctrineExtensions\Query\Mysql\Radians
                        sin: DoctrineExtensions\Query\Mysql\Sin
                    datetime_functions:
                        date: App\DQL\DQLDate
                filters:
                    softdeleteable:
                        class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                        enabled: false
                    enabled_filter:
                        class: App\Filter\EnabledFilter
                        enabled: true
