FriendsOfSymfony/FOSUserBundle — Issue #536: problem when overring form in fosuserbundle
Author: Raulken
Created: 2012-02-19 16:04:35+00:00
State: open

i have add name in entity

/**
* @ORM\Column(type="string", length="255")
*
* @Assert\NotBlank(message="Please enter your name.", groups={"Registration", "Profile"})
* @Assert\MinLength(limit="3", message="The name is too short.", groups={"Registration", "Profile"})
* @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"})
*/
protected $name;

after i have add in form ;
parent::buildForm($builder, $options);

// add your custom field
$builder->add('name');

i have add in service.yml

services:
acme_user.my_provider:
class: Acme\UserBundle\Security\Provider\MyProvider
public: false
arguments: ["@fos_user.user_manager"]

acme_user.registration.form.type:
class: Acme\UserBundle\Form\Type\RegistrationFormType
arguments: [%fos_user.model.user.class%]
tags:
- { name: form.type, alias: acme_user_registration }

i have add in config.yml

registration:
form:
type: acme_user_registration

but return to me this error
Neither property "name" nor method "getName()" nor method "isName()" exists in class "Application\Sonata\UserBundle\Entity\User"

i have try to generate getter and setter with
sudo php app/console doctrine:generate:entities Acme

but say me:
[RuntimeException]
Namespace "Acme" does not contain any mapped entities.