在Symfony中删除父类的映射的学说字段[FOSUserBundle] [英] Remove mapped doctrine field of parentclass in Symfony [FOSUserBundle]

查看:82
本文介绍了在Symfony中删除父类的映射的学说字段[FOSUserBundle]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从映射中删除作为学说列继承的字段?

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

示例:

在FosUserBundle中,我的User类中不需要某些列(例如salt,expiresAt ...).如何告诉symfony/doctrine不再将此列映射到数据库/将其从映射中删除?我知道如何使用@AttributeOverride重新配置"列,但是如何完全从映射中删除字段?

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?

致谢.

推荐答案

FOSUB用户实体的几乎所有默认属性都是强制性的,以使捆绑软件按预期工作.

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

您给定的字段(salt,expiresAt)与安全性有关,这是用户属性的大部分内容.

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.

此外,您不能选择性地继承实体的各个部分.

这篇关于在Symfony中删除父类的映射的学说字段[FOSUserBundle]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆