0

How to delete unwanted fileds in the entity/model: facebook, twitter, bio, website from the Model/User.php ?

I try to ovveride the Model but it doesn't work.

I succed to override the entity, i added some new property, and it work, but want to delete unwanted stuff.

Thx, bye

ibasaw
  • 493
  • 1
  • 7
  • 22

2 Answers2

0

You can create own user entity which will not extend SonataUserBundle User.php class. If you used FOSUSerBundle:

class User extends FOS\UserBundle\Entity\User

or you can extend by default Symfony 2 Security User.php class.

Next you can configure SonataUserBundle to use your user entity:

sonata_user:
    class:
        user: MyBundle\Entity\User

Full configuration is here:

https://github.com/sonata-project/SonataUserBundle/blob/master/Resources/doc/reference/advanced_configuration.rst

If you used SonataUserBundle default controller to manage users you need to create own UserAdmin Class and configure sonata:

sonata_user:
    admin:                  # Admin Classes
        user:
            class:          MyBundle\Admin\UserAdmin
Daniel Korsak
  • 532
  • 4
  • 7
  • i use sonatauserbundle as my own default class user, i override it, but wanna just delete unwanted stufff...it seem not possible in my configuration – ibasaw Jan 21 '13 at 14:03
0

in fact, i got it. I must to extend the model, not the entity, and it works !!! I can remove unwanted stuff

ibasaw
  • 493
  • 1
  • 7
  • 22