当前位置: 首页>>代码示例>>PHP>>正文


PHP User::setSurname方法代码示例

本文整理汇总了PHP中AppBundle\Entity\User::setSurname方法的典型用法代码示例。如果您正苦于以下问题:PHP User::setSurname方法的具体用法?PHP User::setSurname怎么用?PHP User::setSurname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppBundle\Entity\User的用法示例。


在下文中一共展示了User::setSurname方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load

 public function load(ObjectManager $manager)
 {
     $user = new User();
     $user->setName('nuovo');
     $user->setSurname('test');
     $encoder = $this->container->get('security.password_encoder');
     $password = $encoder->encodePassword($user, 'testtest');
     $user->setPassword($password);
     $user->setUsername('nuovo.test');
     $user->setEmail('francesco.viglino@email.com');
     $user->setEnabled(true);
     $manager->persist($user);
     $manager->flush();
     self::$users[] = $user;
 }
开发者ID:kawashita86,项目名称:gpanel,代码行数:15,代码来源:LoadUserData.php

示例2: registrationAction

 /**
  * @Route("/registration/{TrainingId}", name="registration")
  */
 public function registrationAction(Request $request, $TrainingId)
 {
     $returnData = array();
     $em = $this->getDoctrine()->getManager();
     $repositoryUserTraining = $this->getDoctrine()->getRepository('AppBundle:UserTraining');
     $returnData['TrainingUserCount'] = 0;
     $returnData['TrainingUserCount'] = $repositoryUserTraining->getUserCount()[0]['TrainingUserCount'];
     $data = $request->request->all();
     if (isset($data["Patvirtinti"])) {
         $returnData = $this->verificationRegistration($data, $returnData);
         if ($returnData["request"]) {
             $user = new User();
             $user->setName($data['userName']);
             $user->setSurname($data['userSurname']);
             $user->setEmail($data['userEmail']);
             $user->setPhone($data['userPhone']);
             $user->setWorker(false);
             $em->persist($user);
             $em->flush();
             $this->get('session')->set('UserId', $user->getId());
             $this->get('session')->set('UserName', $user->getName());
             $this->get('session')->set('UserSurname', $user->getSurname());
             $this->get('session')->set('worker', false);
             $repositoryUserTraining->setUserInTraining($user->getId(), $TrainingId);
         }
     }
     if (!is_null($this->get('session')->get('UserId'))) {
         $repositoryUserTraining->setUserInTraining($this->get('session')->get('UserId'), $TrainingId);
     }
     $repository = $this->getDoctrine()->getRepository('AppBundle:Training');
     $training = $repository->findById($TrainingId);
     if (!$training) {
         throw $this->createNotFoundException('');
     }
     $returnData['TrainingName'] = $training[0]->getTrainingName();
     $returnData['TrainingUserCountMax'] = $training[0]->getTrainingUserCount();
     $returnData['TrainingId'] = $training[0]->getId();
     return $this->render('default/registration.html.twig', ['data' => $returnData]);
 }
开发者ID:AlinaSoft,项目名称:my_school,代码行数:42,代码来源:DefaultController.php

示例3: createData


//.........这里部分代码省略.........
     $stronieSlaskieCity = new City();
     $stronieSlaskieCity->setProvince($dolnoslaskieProvince);
     $stronieSlaskieCity->setActive(1);
     $stronieSlaskieCity->setName('Stronie Śląskie');
     $em = $this->getDoctrine()->getManager();
     $em->persist($stronieSlaskieCity);
     $em->flush();
     $jeleniaGoraCity = new City();
     $jeleniaGoraCity->setProvince($dolnoslaskieProvince);
     $jeleniaGoraCity->setActive(1);
     $jeleniaGoraCity->setName('Jelenia Góra');
     $em = $this->getDoctrine()->getManager();
     $em->persist($jeleniaGoraCity);
     $em->flush();
     $zmigrodCity = new City();
     $zmigrodCity->setProvince($dolnoslaskieProvince);
     $zmigrodCity->setActive(1);
     $zmigrodCity->setName('Żmigród');
     $em = $this->getDoctrine()->getManager();
     $em->persist($zmigrodCity);
     $em->flush();
     $sobotkaCity = new City();
     $sobotkaCity->setProvince($dolnoslaskieProvince);
     $sobotkaCity->setActive(1);
     $sobotkaCity->setName('Sobótka');
     $em = $this->getDoctrine()->getManager();
     $em->persist($sobotkaCity);
     $em->flush();
     $user = new User();
     $user->setProvince($dolnoslaskieProvince);
     $user->setCity($wroclawCity);
     $user->setActive(1);
     $user->setName('Robert');
     $user->setSurname('Rybiański');
     $user->setLogin('login');
     $user->setPassword(md5('password'));
     $user->setKey(md5(date('Y-m-d H:i:s') . 'password'));
     $user->setEmail('imie@nazwisko.pl');
     $user->setUrl('http://www.domena.pl/');
     $user->setPhone('226666666');
     $user->setStreet('Ulica 6');
     $user->setPostcode('66-666');
     $user->setDescription('Pierwszy użytkownik...');
     $user->setCommentNumber(13);
     $user->setCommentPositive7Days(2);
     $user->setCommentNeutral7Days(1);
     $user->setCommentNegative7Days(0);
     $user->setCommentPositive30Days(3);
     $user->setCommentNeutral30Days(1);
     $user->setCommentNegative30Days(1);
     $user->setCommentPositiveAllDays(10);
     $user->setCommentNeutralAllDays(2);
     $user->setCommentNegativeAllDays(1);
     $user->setCommentDate($dateTime = new \DateTime('2016-03-14 16:31:09'));
     $user->setIpAdded('127.0.0.1');
     $user->setDateAdded($dateTime);
     $user->setIpUpdated('127.0.0.1');
     $user->setDateUpdated($dateTime);
     $user->setIpLoged('127.0.0.1');
     $user->setDateLoged($dateTime);
     $em = $this->getDoctrine()->getManager();
     $em->persist($user);
     $em->flush();
     $firm = new Firm();
     $firm->setUser($user);
     $firm->setProvince($dolnoslaskieProvince);
开发者ID:eerie79,项目名称:fachowcy_svn,代码行数:67,代码来源:DataController.php

示例4: registerAction

 /**
  * @Route("/rejestracja")
  */
 public function registerAction(Request $request)
 {
     $config = new Config();
     $session = $request->getSession();
     $cookieLogin = new CookieLogin($em = $this->getDoctrine()->getManager());
     $cookieLogin->setCookieLogin($session);
     $quickForm = new QuickForm($this, $request);
     $email = new Email($this);
     $messageString = '';
     $messageClass = 'bad';
     $registerForm = new RegisterForm();
     $form = $this->createForm(RegisterFormType::class, $registerForm);
     $form->handleRequest($request);
     if ($form->isSubmitted()) {
         $validator = $this->get('validator');
         $errors = $validator->validate($registerForm);
         if (count($errors) > 0) {
             foreach ($errors as $error) {
                 $messageString .= $error->getMessage() . '<br />';
             }
         } else {
             if ($this->getDoctrine()->getRepository('AppBundle:User')->isUserLogin($registerForm->getLogin())) {
                 $messageString .= 'Konto o podanym loginie już istnieje.<br />';
             } else {
                 $user = new User();
                 $user->setProvince(NULL);
                 $user->setCity(NULL);
                 $user->setActive(0);
                 $user->setName($registerForm->getName());
                 $user->setSurname($registerForm->getSurname());
                 $user->setLogin($registerForm->getLogin());
                 $user->setPassword(md5($registerForm->getPassword()));
                 $user->setKey(md5(date('Y-m-d H:i:s') . $registerForm->getPassword()));
                 $user->setEmail($registerForm->getEmail());
                 $user->setUrl('');
                 $user->setPhone('');
                 $user->setStreet('');
                 $user->setPostcode('');
                 $user->setDescription('');
                 $user->setCommentNumber(0);
                 $user->setCommentPositive7Days(0);
                 $user->setCommentNeutral7Days(0);
                 $user->setCommentNegative7Days(0);
                 $user->setCommentPositive30Days(0);
                 $user->setCommentNeutral30Days(0);
                 $user->setCommentNegative30Days(0);
                 $user->setCommentPositiveAllDays(0);
                 $user->setCommentNeutralAllDays(0);
                 $user->setCommentNegativeAllDays(0);
                 $user->setCommentDate($dateTime = new \DateTime('now'));
                 $user->setIpAdded($config->getRemoteAddress());
                 $user->setDateAdded($dateTime);
                 $user->setIpUpdated('');
                 $user->setDateUpdated(new \DateTime('1970-01-01 00:00:00'));
                 $user->setIpLoged('');
                 $user->setDateLoged(new \DateTime('1970-01-01 00:00:00'));
                 $em = $this->getDoctrine()->getManager();
                 $em->persist($user);
                 $em->flush();
                 $messageString .= 'Konto użytkownika zostało utworzone.<br />';
                 $messageClass = 'ok';
                 if ($this->sendActivationEmail($config, $email, $registerForm, $user)) {
                     $messageString .= 'Sprawdź pocztę w celu aktywacji konta.<br />';
                 } else {
                     $messageString .= "Wysłanie e-mail'a aktywacyjnego nie powiodło się.<br />";
                     $messageClass = 'bad';
                 }
                 unset($registerForm);
                 unset($form);
                 $registerForm = new RegisterForm();
                 $form = $this->createForm(RegisterFormType::class, $registerForm);
             }
         }
     }
     $menu = new Menu($em, 1, 0);
     return $this->render('register/register.html.twig', array('session' => $session->get('user'), 'quickForm' => $quickForm->createView(), 'form' => $form->createView(), 'messageString' => $messageString, 'messageClass' => $messageClass, 'activeCategory' => 1, 'activeProvince' => 0, 'activeCity' => 0, 'categories' => $menu->getCategories(), 'places' => $menu->getPlaces(), 'isProvince' => $menu->isProvince()));
 }
开发者ID:eerie79,项目名称:fachowcy_svn,代码行数:80,代码来源:RegisterController.php


注:本文中的AppBundle\Entity\User::setSurname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。