Skip to content

Instantly share code, notes, and snippets.

@elnur
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save elnur/116db7b846036d32712c to your computer and use it in GitHub Desktop.

Select an option

Save elnur/116db7b846036d32712c to your computer and use it in GitHub Desktop.
How to Enable the Underscore Naming Strategy for Doctrine ORM in Symfony http://elnur.pro/how-to-enable-the-underscore-naming-strategy-for-doctrine-orm-in-symfony/
doctrine:
orm:
naming_strategy: doctrine.orm.naming_strategy.underscore
CREATE TABLE super_user
(
first_name varchar,
last_name varchar
);
<?php
class SuperUser
{
private $firstName;
private $lastName;
}
<?php
use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\Column;
/**
* @Table("super_user")
*/
class SuperUser
{
/**
* @Column("first_name")
*/
private $firstName;
/**
* @Column("last_name")
*/
private $lastName;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment