Using Symfony 2.7, I am trying to create a user registration form. I've used Symfony's own guide for this, and the form is rendered and fillable.
When I fill in the form, and press "Register", I get the following error.
Unable to find the object manager associated with an entity of class "UserBundle\Models\User"
This is triggered on the following condition in vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php at line 75
$em = $this->registry->getManagerForClass(get_class($entity));
if (!$em) {
throw new ConstraintDefinitionException(sprintf('Unable to find the object manager associated with an entity of class "%s".', get_class($entity)));
}
In the createAction in my UserController, the Entity Manager is fetched by $em = $this->getDoctrine()->getManager();
as per the instructions in the Symfony Cookbook.
I can't find out what's going here. Any help appreciated!
Also, please let me know if there is some information missing that I should have provided.