public function registerAction()
    {
        $entity  = new PreUser();
        $request = $this->getRequest();
        $form    = $this->createForm(new RegistrationForm(), $entity);
        $form->bindRequest($request);

        if ($form->isValid()) {

            $entity->setRegisteredOn(new \DateTime('now'));
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();

            //Generate Token based on ID assigned
            $entity->setToken(base_convert($entity->getId() + 100000000, 10, 32));
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('launcher_done', array('token' => $entity->getToken())));

        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }
public function registerAction()
    {
        $entity  = new PreUser();
        $request = $this->getRequest();
        $form    = $this->createForm(new RegistrationForm(), $entity);
        $form->bindRequest($request);

        if ($form->isValid()) {

            $entity->setRegisteredOn(new \DateTime('now'));
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();

            //Generate Token based on ID assigned
            $entity->setToken(base_convert($entity->getId() + 100000000, 10, 32));
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('launcher_done', array('token' => $entity->getToken())));

        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }
public function registerAction ( ) { $ entity = new PreUser ( ) ; $ request = $ this -> getRequest ( ) ; $ form = $ this -> createForm ( new RegistrationForm ( ) , $ entity ) ; $ form -> bindRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ entity -> setRegisteredOn ( new \ DateTime ( 'now' ) ) ; $ em = $ this -> getDoctrine ( ) -> getEntityManager ( ) ; $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; //Generate Token based on ID assigned $ entity -> setToken ( base_convert ( $ entity -> getId ( ) + 100000000 , 10 , 32 ) ) ; $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'launcher_done' , array ( 'token' => $ entity -> getToken ( ) ) ) ) ; } return array ( 'entity' => $ entity , 'form' => $ form -> createView ( ) ) ; }
Creates a new PreUser entity.

@Route("/launcher/register", name="launcher_register")
@Method("post")
@Template("DMSLauncherBundle:Default:index.html.twig")
Creates a new PreUser entity .