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


PHP User::setDescription方法代码示例

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


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

示例1: load

 public function load(ObjectManager $manager)
 {
     $faker = \Faker\Factory::create();
     $x = 0;
     while ($x++ < 25) {
         $team = $this->getReference("team-{$x}");
         $i = 0;
         while ($i++ < 14) {
             $player = new User();
             $player->setName($faker->firstName);
             $player->setLastName($faker->lastName);
             $player->setRole(User::ROLE_PLAYER);
             $player->setDescription($faker->text);
             $player->setTeam($team);
             $manager->persist($player);
             $manager->flush();
         }
         $i = 0;
         while ($i++ < 4) {
             $coach = new User();
             $coach->setName($faker->firstName);
             $coach->setLastName($faker->lastName);
             $coach->setRole(User::ROLE_COACH);
             $coach->setDescription($faker->text);
             $coach->setTeam($team);
             $manager->persist($coach);
             $manager->flush();
         }
     }
 }
开发者ID:Wolframcheg,项目名称:GeekhubHW7,代码行数:30,代码来源:LoadUsersData.php

示例2: createData


//.........这里部分代码省略.........
     $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);
     $firm->setCity($wroclawCity);
     $firm->setActive(1);
     $firm->setVisible(1);
     $firm->setOrder(1);
     $firm->setName('Firma Pierwsza');
     $firm->setEmail('nazwa@firma.pl');
     $firm->setUrl('http://www.firma.pl/');
     $firm->setPhone('226669999');
     $firm->setStreet('Ulica 9');
开发者ID:eerie79,项目名称:fachowcy_svn,代码行数:67,代码来源:DataController.php

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