當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::setStatus方法代碼示例

本文整理匯總了PHP中AppBundle\Entity\User::setStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::setStatus方法的具體用法?PHP User::setStatus怎麽用?PHP User::setStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AppBundle\Entity\User的用法示例。


在下文中一共展示了User::setStatus方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addUserAction

 /**
  * @Route("/addUser/{uname}/{pswd}/{email}/{age}/{pic}/{phone}/{status}/{credit}")
  */
 public function addUserAction($uname, $pswd, $email, $age, $pic, $phone, $status, $credit)
 {
     $response = new JsonResponse();
     $res = $this->uniqAction($uname, $email, $phone, $credit);
     if (empty($res)) {
         $date = new \DateTime($age);
         //$date->format('Y-m-d');
         $user = new User();
         $user->setName($uname);
         $user->setNickName($uname);
         $user->setPassword($pswd);
         $user->setEmail($email);
         $user->setBirthday($date);
         $user->setPicpath($pic);
         $user->setPhone($phone);
         $user->setStatus($status);
         $user->setCredit($credit);
         $em = $this->getDoctrine()->getManager();
         $em->persist($user);
         $em->flush();
         //print_r($user);
         $response->setData(array('response' => array('profile' => array(array("valid" => true)))));
     } else {
         $response->setData(array('response' => array('profile' => array($res))));
     }
     return $response;
 }
開發者ID:Cronverk,項目名稱:application,代碼行數:30,代碼來源:UserController.php

示例2: confirmAction

 /**
  * @C\Route(
  *     "/confirm/{id}/{token}",
  *     name="user_confirm",
  *     requirements = {
  *         "id" : "\d+"
  *     }
  * )
  * @C\Method("GET")
  * @C\Template("AppBundle::message.html.twig")
  * @C\ParamConverter("user", class="AppBundle:User")
  * 
  * @param User $user
  * @param string $token 
  * 
  * @return array
  */
 public function confirmAction(User $user, $token)
 {
     $title = "Email confirmation";
     $message = "Confirmation failed";
     if ($user->getConfirmToken() === $token) {
         $user->setStatus(User::STATUS_ACTIVE);
         $em = $this->get('doctrine.orm.entity_manager');
         $em->persist($user);
         $em->flush();
         $message = "Confirmation succeded";
     }
     return ['title' => $title, 'message' => $message];
 }
開發者ID:sirnec,項目名稱:tm,代碼行數:30,代碼來源:AuthController.php

示例3: setStatus

 /**
  * {@inheritDoc}
  */
 public function setStatus($status)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setStatus', array($status));
     return parent::setStatus($status);
 }
開發者ID:johnpaulada,項目名稱:oauth-api-test,代碼行數:8,代碼來源:__CG__AppBundleEntityUser.php


注:本文中的AppBundle\Entity\User::setStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。