/**
  * @param string $class
  * @return RedirectResponse
  */
 public function edit($class)
 {
     $this->userDiscriminator->setClass($class);
     $this->controller->setContainer($this->container);
     $result = $this->controller->editAction($this->getRequest());
     if ($result instanceof RedirectResponse) {
         return $this->controller->redirect($this->getRequest()->getRequestUri());
     }
     $template = $this->userDiscriminator->getTemplate('profile');
     if (is_null($template)) {
         $template = 'FOSUserBundle:Profile:edit.html.twig';
     }
     $form = $this->formFactory->createForm();
     return $this->container->get('templating')->renderResponse($template, array('form' => $form->createView()));
 }
 /**
  * 
  * @param string $class
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function register($class)
 {
     $this->userDiscriminator->setClass($class);
     $this->controller->setContainer($this->container);
     $result = $this->controller->registerAction($this->container->get('request'));
     if ($result instanceof RedirectResponse) {
         return $result;
     }
     $template = $this->userDiscriminator->getTemplate('registration');
     if (is_null($template)) {
         $template = 'FOSUserBundle:Registration:register.html.twig';
     }
     $form = $this->formFactory->createForm();
     return $this->container->get('templating')->renderResponse($template, array('form' => $form->createView()));
 }