扩展 Sonata User Bundle 并添加新字段 [英] Extending Sonata User Bundle and adding new fields

查看:23
本文介绍了扩展 Sonata User Bundle 并添加新字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在扩展 Sonata 用户包并在新用户实体中创建一些额外的字段.这些字段只会在用户下的 Sonata 管理区域内更新,因此它们不需要在编辑配置文件表单中可用.我无法通过 Sonata 用户管理器更新这些字段,并尝试了几种不同的方法来扩展/实现 ApplicationSonataUserBundle 中的该类.有没有人以前遇到过这个问题,可以给我一个教程或分步过程,以最干净的方式扩展新的 User 实体?

I am extending the Sonata User Bundle and creating some extra fields in the new user entity. These fields will only be updated within the Sonata admin area under users so they do not need to be available in the edit profile form. I am having trouble updating these fields via the Sonata User Manager and tried several different ways to extend/implement that class in ApplicationSonataUserBundle. Has anyone encountered this before and can give me a tutorial or step by step process of the cleanest way to extend the new User entity?

推荐答案

我发现这个问题是一个教义问题.我的扩展包使用了原始的 xml 字段映射.我删除了这些文件并恢复为注释.从那里一切都非常出色.我希望这能帮助遇到同样问题的其他人.

I found out the issue was a doctrine issue. My extended bundle was utilizing the original xml field mappings. I deleted those files and reverted to annotations. Everything worked brilliantly from there. I hope this helps someone else who is experiencing the same issue.

这篇关于扩展 Sonata User Bundle 并添加新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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