if ($form->isValid()) {
$em->persist($user);
$em->flush();
return new JsonResponse(array('status' => 'ok'));
} else {
return new JsonResponse(array('status' => 'fail', 'errors' => $this->getErrorMessages($form)));
}
class UserEditType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$transformer = new StringToArrayTransformer();
$builder->add('username', null, array(
'label' => 'Username',
'translation_domain' => 'FOSUserBundle'
));
$builder->add('email', 'email', array(
'label' => 'Email',
'translation_domain' => 'FOSUserBundle'
));
$builder->add('phone', 'text', array(
'label' => 'Phone'
));
}
[request] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
[user] => Array
(
[_token] => m36vaRJa9uNp_IJcytZlnN_nhYJj259AyEJvhwqMPzg
[username] => Aleen Westfffffsdfddxc
[email] => nova.ggprice@yahoo.com
[phone] => 2043581454
[x1] => 100
[y1] => 150
[x2] => 200
[y2] => 200
ContextErrorException: Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1588
in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1588
at ErrorHandler->handle('2', 'spl_object_hash() expects parameter 1 to be object, null given', '/home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php', '1588', array('entity' => null, 'visited' => array('0000000015d2e02000007ffb59e110f8' => object(User), '0000000015d2e07b00007ffb59e110f8' => object(Image), '0000000015d2e51c00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e5b000007ffb59e110f8' => object(Project), '0000000015d2e52700007ffb59e110f8' => object(User), '0000000015d2e61000007ffb59e110f8' => object(OperationType), '0000000015d2e61d00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e50900007ffb59e110f8' => object(OperationType), '0000000015d2e6de00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e6ff00007ffb59e110f8' => object(OperationType), '0000000015d2e61900007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62a00007ffb59e110f8' => object(OperationType), '0000000015d2e62f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62000007ffb59e110f8' => object(OperationType), '0000000015d2e62b00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63e00007ffb59e110f8' => object(OperationType), '0000000015d2e62100007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63400007ffb59e110f8' => object(OperationType), '0000000015d2e63f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63200007ffb59e110f8' => object(OperationType), '0000000015d2e63500007ffb59e110f8' => object(ProjectPermission), '0000000015d2e64800007ffb59e110f8' => object(OperationType))))
at spl_object_hash(null) in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1588
at UnitOfWork->doPersist(null, array('0000000015d2e02000007ffb59e110f8' => object(User), '0000000015d2e07b00007ffb59e110f8' => object(Image), '0000000015d2e51c00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e5b000007ffb59e110f8' => object(Project), '0000000015d2e52700007ffb59e110f8' => object(User), '0000000015d2e61000007ffb59e110f8' => object(OperationType), '0000000015d2e61d00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e50900007ffb59e110f8' => object(OperationType), '0000000015d2e6de00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e6ff00007ffb59e110f8' => object(OperationType), '0000000015d2e61900007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62a00007ffb59e110f8' => object(OperationType), '0000000015d2e62f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62000007ffb59e110f8' => object(OperationType), '0000000015d2e62b00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63e00007ffb59e110f8' => object(OperationType), '0000000015d2e62100007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63400007ffb59e110f8' => object(OperationType), '0000000015d2e63f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63200007ffb59e110f8' => object(OperationType), '0000000015d2e63500007ffb59e110f8' => object(ProjectPermission), '0000000015d2e64800007ffb59e110f8' => object(OperationType))) in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 2205
at UnitOfWork->cascadePersist(object(User), array('0000000015d2e02000007ffb59e110f8' => object(User), '0000000015d2e07b00007ffb59e110f8' => object(Image), '0000000015d2e51c00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e5b000007ffb59e110f8' => object(Project), '0000000015d2e52700007ffb59e110f8' => object(User), '0000000015d2e61000007ffb59e110f8' => object(OperationType), '0000000015d2e61d00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e50900007ffb59e110f8' => object(OperationType), '0000000015d2e6de00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e6ff00007ffb59e110f8' => object(OperationType), '0000000015d2e61900007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62a00007ffb59e110f8' => object(OperationType), '0000000015d2e62f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62000007ffb59e110f8' => object(OperationType), '0000000015d2e62b00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63e00007ffb59e110f8' => object(OperationType), '0000000015d2e62100007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63400007ffb59e110f8' => object(OperationType), '0000000015d2e63f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63200007ffb59e110f8' => object(OperationType), '0000000015d2e63500007ffb59e110f8' => object(ProjectPermission), '0000000015d2e64800007ffb59e110f8' => object(OperationType))) in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1631
at UnitOfWork->doPersist(object(User), array('0000000015d2e02000007ffb59e110f8' => object(User), '0000000015d2e07b00007ffb59e110f8' => object(Image), '0000000015d2e51c00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e5b000007ffb59e110f8' => object(Project), '0000000015d2e52700007ffb59e110f8' => object(User), '0000000015d2e61000007ffb59e110f8' => object(OperationType), '0000000015d2e61d00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e50900007ffb59e110f8' => object(OperationType), '0000000015d2e6de00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e6ff00007ffb59e110f8' => object(OperationType), '0000000015d2e61900007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62a00007ffb59e110f8' => object(OperationType), '0000000015d2e62f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e62000007ffb59e110f8' => object(OperationType), '0000000015d2e62b00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63e00007ffb59e110f8' => object(OperationType), '0000000015d2e62100007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63400007ffb59e110f8' => object(OperationType), '0000000015d2e63f00007ffb59e110f8' => object(ProjectPermission), '0000000015d2e63200007ffb59e110f8' => object(OperationType), '0000000015d2e63500007ffb59e110f8' => object(ProjectPermission), '0000000015d2e64800007ffb59e110f8' => object(OperationType))) in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1569
at UnitOfWork->persist(object(User)) in /home/dsazz/sites/postformula.ua/www/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php line 624
at EntityManager->persist(object(User)) in /home/dsazz/sites/postformula.ua/www/src/Postformula/MainBundle/Controller/UserController.php line 146
at UserController->editAction()
at call_user_func_array(array(object(UserController), 'editAction'), array()) in /home/dsazz/sites/postformula.ua/www/app/bootstrap.php.cache line 2951
at HttpKernel->handleRaw(object(Request), '1') in /home/dsazz/sites/postformula.ua/www/app/bootstrap.php.cache line 2923
at HttpKernel->handle(object(Request), '1', true) in /home/dsazz/sites/postformula.ua/www/app/bootstrap.php.cache line 3062
at ContainerAwareHttpKernel->handle(object(Request), '1', true) in /home/dsazz/sites/postformula.ua/www/app/bootstrap.php.cache line 2305
at Kernel->handle(object(Request)) in /home/dsazz/sites/postformula.ua/www/web/app_dev.php line 28