phps-cans/quote-strategy.doctrine.escaping

This package contains an implementation of Doctrine\ORM\Mapping\QuoteStrategy which automatically escape database reserved keyword for table and column alias.

1.0.x-dev 2017-02-16 16:08 UTC

This package is not auto-updated.

Last update: 2024-12-21 21:47:33 UTC


README

As said in Doctrine Documentation is you want to use protected keywords for table or column name you will have to explicitly use ticks in the definition.

This will break NamingStrategy provide by doctrine and required you to know what words are protected in the database you use.

With this implementation of the QuoteStrategy interface you will not have to bother with it anymore.

Just add our EscapingQuoteStrategy to Doctrine configuration :

$configuration->setQuoteStrategy(new EscapingQuoteStrategy());