mapado / MysqlDoctrineFunctions

MySQL Function for Doctrine : RAND(), ROUND() DATE(), DATE_FORMAT()
Other
44 stars 5 forks source link

Unrecognized options "naming_strategy, auto_mapping" under "doctrine.orm" #8

Open sterichards opened 6 years ago

sterichards commented 6 years ago

This is the Symfony2 error I get, after the library installation, when adding the config and clearing the cache

jdeniau commented 6 years ago

IIRC with doctrine, you have 2 ways of configuring entity managers, one "helper" that makes only one entity manager available :

doctrine:
  orm:
    mappings: []
    auto_mapping: false

and the other one that is more verbose but supports multiple entity managers:

doctrine:
  orm:
    entity_managers:
      some_em:
        mappings: []
        auto_mapping: false

Either you need to use the first syntax with:

doctrine:
    orm:
        dql:
            numeric_functions:
                rand:        Mapado\MysqlDoctrineFunctions\DQL\MysqlRand
                round:       Mapado\MysqlDoctrineFunctions\DQL\MysqlRound
            datetime_functions:
                date:        Mapado\MysqlDoctrineFunctions\DQL\MysqlDate
                date_format: Mapado\MysqlDoctrineFunctions\DQL\MysqlDateFormat
                # ... add all functions you need

or you need to switch to the verbose syntax