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.
Installs: 1 025
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Type:user
Requires
- php: >= 5.6.0
- doctrine/orm: ~2.0
This package is not auto-updated.
Last update: 2024-11-09 21:10:41 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());