扩展Sonata用户捆绑包并添加新字段 [英] Extending Sonata User Bundle and adding new fields

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

问题描述

我正在扩展Sonata用户捆绑包,并在新的用户实体中创建一些额外的字段.这些字段只会在用户下方的Sonata管理区域内更新,因此不需要在编辑配置文件表单中使用.我在通过Sonata用户管理器更新这些字段时遇到了麻烦,并尝试了几种不同的方法来扩展/实现Application \ Sonata \ UserBundle中的该类.以前有没有人遇到过这个问题,并且可以给我提供扩展新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 Application\Sonata\UserBundle. 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用户捆绑包并添加新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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