PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Rafael Espinosa   Doctrine Dot Naming Strategy   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Auxiliary data
Class: Doctrine Dot Naming Strategy
Set a naming strategy for Doctring mapping dots
Author: By
Last change:
Date: 9 years ago
Size: 820 bytes
 

Contents

Class file image Download

Doctrine ORM DotNamingStrategy

Automatic table names conversion from schema.name to schema_name, ie. change database connection from postgresql to mysql.

Symfony2

You must set this class as service in container

<parameters>
    <parameter key="doctrine.orm.naming_strategy.dot.class">Fluency\Component\Doctrine\ORM\Mapping\DotNamingStrategy</parameter>
</parameters>
<services>
...
<service id="doctrine.orm.naming_strategy.dot"
    class="%doctrine.orm.naming_strategy.dot.class%" public="false" />
...
</services>

Orm settings

...
orm:
    auto_generate_proxy_classes: %kernel.debug%
#        auto_mapping: true
    default_entity_manager: default
    entity_managers:
        default:
            connection: default
            naming_strategy: doctrine.orm.naming_strategy.dot
...