symfony - Symfony2 FOSUserBundle User entity field override -


I have a problem overriding an organization. I do not need the field email legal to be unique.

Here's what I did: XML in my UserBundle \ resources \ config \ doctrine \ User.orm

  & lt; Feature-override & gt; Accordingly, I've added the  attribute-override  configuration. & Lt; Attribute-override name = "email canonical" & gt; & Lt; Field column = "email_connectional" unique = "wrong" name = "email canonical" /> & Lt; / Feature-override & gt; & Lt; / Feature-override & gt;   

Then I run the following console command

  $ php app / console doctrine: migration: diff $ php app / console doctrine: migrations: migrate   

Everything worked well Email Connection was made non-unique but now, when I need to create a unit in the other bundles of the project, then I have a strange error:

  $ php app / console doctrine: generated: entities Skydom's bundle: category building unit "sky \ bundle \ model bundle \ unit \" Invalid field override named "email connical" named for category "[principle \ ORM \ mapping \ mapping exposition] 'Sky bundle \ user bundle \ unit \ user' However, if I remove override settings from XML mapping, then Everything works fine. .   

You override this using PPL annotations (starting with this principle version 2.3 and above Please note that in the documentation it is mentioned that you can not override the types, although I was able to do this using the latest principle according to 2.4.4 at the time of writing it:

  & lt; php namespace namespace \ user bundle \ ucc Use the principle / ORM \ mapping as ORM; Use the Symfony \ Component \ Validator \ Constraints; Use FOS \ UserBundle \ Model \ User as BaseUser; / * * User * @ORM \ Entity * @ORM \ AttributeOverrides ({* @ORM \ AttributeOverride (name = "id", * column = @ ORM \ column (* name = "guest_id", * type = "integer", * length = 140 *) * ) *} * / Class extends myUser BaseUser {/ ** * @ORM \ Id () * @ORM \ column (type = "integer") * @ORM / Generated Value (strategy = "auto") * / Protected $ Id; }   

It is specified in the documentation:

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -