Skip to content

Instantly share code, notes, and snippets.

@beberlei
Created July 9, 2012 09:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beberlei/3075331 to your computer and use it in GitHub Desktop.
Save beberlei/3075331 to your computer and use it in GitHub Desktop.
Customize Trait Doctrine Mappings with AttributeOverride
<?php
namespace MyBundle\Entity;
use Doctrine\ORM\Mapping AS ORM;
/**
* @ORM\Entity
* @ORM\AttributeOverrides({
* @ORM\AttributeOverride(name="id", column=@ORM\Column(name="table_id"))
* })
*/
class User
{
use UserTrait;
}
<?php
namespace MyBundle\Entity;
use Doctrine\ORM\Mapping AS ORM;
trait UserTrait
{
/**
* @ORM\Column(type="integer")
*/
private $id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment