Ejemplo n.º 1
0
 /**
  * 登入成功後的回呼動作
  * 
  * @param  Session $session 
  * @param  Custom  $custom 
  * @param  Entity Manager $em
  * @return $this           
  */
 private function loginSuccessCallback(Session $session, Custom $custom, $em)
 {
     $custom->setCsrf('avenue2003');
     $custom->setPreCsrf($custom->getCsrf());
     $em->persist($custom);
     $em->flush();
     $serializer = \JMS\Serializer\SerializerBuilder::create()->build();
     $session->set('custom', $serializer->serialize($custom, 'json'));
     $session->set('avenue_token', $custom->getCsrf());
     return $this;
 }