/**
  * 
  * @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()));
 }