doctrine.yaml 3.11 KB
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

        # 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:
        auto_generate_proxy_classes: '%kernel.debug%'
        entity_managers:
            default:
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: true
                mappings:
                    ApplicationSonataClassificationBundle: ~
                    SonataClassificationBundle: ~
                    ApplicationSonataMediaBundle: ~
                    SonataMediaBundle: ~
                    App:
                        is_bundle: false
                        type: annotation
                        dir: '%kernel.project_dir%/src/Entity'
                        prefix: 'App\Entity'
                        alias: App
                    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
                    numeric_functions:
                        acos: DoctrineExtensions\Query\Mysql\Acos
                        cos: DoctrineExtensions\Query\Mysql\Cos
                        radians: DoctrineExtensions\Query\Mysql\Radians
                        sin: DoctrineExtensions\Query\Mysql\Sin
                filters:
                    softdeleteable:
                        class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                        enabled: true
                    enabled_filter:
                        class: App\Filter\EnabledFilter
                        enabled: true