MysqlDoctrineFunctions icon indicating copy to clipboard operation
MysqlDoctrineFunctions copied to clipboard

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

Open sterichards opened this issue 7 years ago • 1 comments

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

sterichards avatar Jun 04 '18 12:06 sterichards

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

jdeniau avatar Jun 04 '18 19:06 jdeniau