Using fosUserBundle in Symfony2 with Doctrine. Here are the versions :
- "symfony/symfony": "2.7.7"
- "doctrine/orm": "^2.4.8"
- "doctrine/doctrine-bundle": "~1.4"
- "friendsofsymfony/user-bundle": "~2.0.0-alpha3"
Trying to override column name such as username one.
Here is what I do : namespace PROJECT\BUNDLE\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\Groups;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table(name="PROJECT_BUNDLE_USER")
* @ORM\Entity(repositoryClass="PROJECT\BUNDLE\Entity\UserRepository")
* @ORM\AttributeOverrides({
* @ORM\AttributeOverride(name="username",
* column=@ORM\Column(
* name = "BUNDLE_USERNAME"
* )
* ),
[....]
* })
*/
class User extends BaseUser
{
[....]
When I want to generate the entity with php app/console doctrine:generate:entities PROJECT
[Doctrine\ORM\Mapping\MappingException]
Invalid field override named 'username' for class 'PROJECT\BUNDLE\Entity\User'.
EDIT 1 : add of namespace and use
EDIT 2 : Same error with type and length attributes fullfiled :
column=@ORM\Column(
* name = "USER_USERNAME",
* type = "string",
* length = 255
* )
namespace
anduse
s statements for you User entity? – Davi Koscianski Vidal