Remove mapped doctrine field of parentclass in Symfony [FOSUserBundle]

隐身守侯 提交于 2019-12-11 05:28:46

问题


How is it possible to remove a field that got inherited as doctrine column from mapping?

Example:

In FosUserBundle, I don't need some of the columns (e.g. salt, expiresAt...) within my User class. How can I tell symfony/doctrine to not map this column anymore to the database / remove it from the mapping? I know how to "reconfigure" the columns by using @AttributeOverride, but how can I completly remove a field from the mapping?

Regards.


回答1:


Pretty much all default properties of the FOSUB User entity are mandatory to make the bundle working as expected.

The fields you given (salt, expiresAt) are related to the security, as the most part of the User properties.

Remove one of them may have side effects in your user management.

Also, you can't Selectively inherit parts of an entity.



来源:https://stackoverflow.com/questions/35917844/remove-mapped-doctrine-field-of-parentclass-in-symfony-fosuserbundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!