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


PHP User::getEmail方法代码示例

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


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

示例1: testFindUserByEmail

 public function testFindUserByEmail()
 {
     setUp();
     $this->user = $this->em->getRepository('AppBundle:User')->findUserByEmail("shiluib@student.uib.no");
     $this->assertEquals("shiluib@student.uib.no", $this->user->getEmail());
     tearDown();
 }
开发者ID:vegardbb,项目名称:webpage,代码行数:7,代码来源:UserRepositoryFunctionalTest.php

示例2: addCustomer

 /**
  * @param User $user
  * @param $request
  * @throws Exception
  * @return User
  */
 public function addCustomer(User $user, $request)
 {
     $stripeToken = $request->request->get('token');
     //register stripe customer if necessary
     $customer = StripeCustomer::create(["description" => sprintf("UserId %s email %s", $user->getId(), $user->getEmail()), "source" => $stripeToken, "email" => $user->getEmail()]);
     if (!$customer->id) {
         throw new Exception("stripe create customer failed");
     }
     $user->setStripeCustomerId($customer->id);
     return true;
 }
开发者ID:jducro,项目名称:music-school,代码行数:17,代码来源:StripePaymentGateway.php

示例3: checkUserLabeli

 public function checkUserLabeli(User $user)
 {
     $userNom = strtolower($user->getNom());
     $userPrenom = strtolower($user->getPrenom());
     $userMail = strtolower($user->getEmail());
     $labelis = $this->em->getRepository('AppBundle:Labeli')->findAll();
     foreach ($labelis as $labeli) {
         $labeliNom = strtolower($labeli->getNom());
         $labeliPrenom = strtolower($labeli->getPrenom());
         $labeliMail = strtolower($labeli->getMail());
         if ($userNom == $labeliNom && $userPrenom == $labeliPrenom || $userPrenom == $labeliNom && $userNom == $labeliPrenom || $userMail == $labeliMail) {
             if ($labeli->getHonored() == 1) {
                 $subject = 'Confirmation Invités d\'Honneur LGC';
                 $template = '::email/honored.html.twig';
             } else {
                 $subject = 'Confirmation participant Label[i]';
                 $template = '::email/labeli.html.twig';
             }
             $user->setPayed(1);
             $this->em->flush();
             $mailUser = $user->getEmail();
             $message = \Swift_Message::newInstance()->setSubject($subject)->setFrom('lgc@labeli.org')->setTo($userMail)->setBody($this->container->get('templating')->render($template), 'text/html');
             $this->container->get('mailer')->send($message);
             $user->setMailPayed(1);
             $this->em->persist($user);
             $this->em->flush();
         }
     }
 }
开发者ID:NanaRT,项目名称:labelilan,代码行数:29,代码来源:ApplicationListener.php

示例4: getUserAction

 /**
  * @Route("/users/:{id}", name="rest_user")
  * @param User $user
  * @return array
  * @View()
  * @ParamConverter("user",class="AppBundle:User")
  */
 public function getUserAction(User $user)
 {
     $em = $this->getDoctrine()->getManager();
     $users = $em->getRepository('AppBundle:User')->findAll();
     // get data, in this case list of users.
     return array('user' => array('login' => $user->getUsername(), 'email' => $user->getEmail(), 'adresse' => $user->getAdresse(), 'telephone' => $user->getNumero(), 'sitweb' => $user->getSiteweb()));
 }
开发者ID:KtuluWU,项目名称:Carnet-d-adresses,代码行数:14,代码来源:RestController.php

示例5: canYouDoIt

 private function canYouDoIt(Comment $comment, User $user)
 {
     $commentOwner = $this->doctrine->getRepository('AppBundle:User')->findOneBy(array('email' => $comment->getAuthorEmail()));
     if (in_array("ROLE_ADMIN", $commentOwner->getRoles()) || $comment->getPost()->getAuthorEmail() !== $user->getEmail()) {
         return false;
     }
     return true;
 }
开发者ID:syrotchukandrew,项目名称:blog,代码行数:8,代码来源:CommentVoter.php

示例6: testSetEmail

 public function testSetEmail()
 {
     // new entity
     $user = new User();
     // Use the setEmail method
     $user->setEmail("per@mail.com");
     // Assert the result
     $this->assertEquals("per@mail.com", $user->getEmail());
 }
开发者ID:vegardbb,项目名称:webpage,代码行数:9,代码来源:UserEntityUnitTest.php

示例7: sendUserBlockedMessage

 public function sendUserBlockedMessage(Request $request, User $user)
 {
     $template = 'Emails/User/mail_user_blocked.html.twig';
     $emailHtml = $this->renderView($template, array('user' => $user, 'mailer_app_url_prefix' => $this->getParameter('mailer_app_url_prefix')));
     $subject = "User bloked.";
     $from = array($this->getParameter('mailer_fromemail') => $this->getParameter('mailer_fromname'));
     $message = Swift_Message::newInstance()->setSubject($subject)->setFrom($from)->setTo($user->getEmail())->setBody($emailHtml, 'text/html');
     $this->get('mailer')->send($message);
 }
开发者ID:gitroberto,项目名称:heyrentme,代码行数:9,代码来源:UserController.php

示例8: addCustomer

 /**
  * @param User $user
  * @param $request
  * @throws
  * @return User
  */
 public function addCustomer(User $user, $request)
 {
     $result = BraintreeCustomer::create(['id' => 'userid-' . $user->getId(), 'email' => $user->getEmail(), "creditCard" => ["number" => $request->request->get("number"), "cvv" => $request->request->get("cvv"), "expirationMonth" => $request->request->get("month"), "expirationYear" => $request->request->get("year")]]);
     if ($result->success === true) {
         $user->setBraintreeCustomerId($result->customer->id);
     } else {
         throw new Exception("Braintree create customer failed");
     }
     return $result->success;
 }
开发者ID:jducro,项目名称:music-school,代码行数:16,代码来源:BraintreePaymentGateway.php

示例9: testSetEmail

 /**
  * Tests if the username property is set, if its not set while setting the email
  */
 public function testSetEmail()
 {
     $user = new User();
     $this->assertNull($user->getEmail());
     $user->setEmail('foo@bar.com');
     $this->assertEquals($user->getEmail(), $user->getUsername());
     $secondUser = new User();
     $secondUser->setUsername('username');
     $secondUser->setEmail('foo@bar.com');
     $this->assertNotEquals($secondUser->getEmail(), $secondUser->getUsername());
 }
开发者ID:avanthay,项目名称:timekipr,代码行数:14,代码来源:UserTest.php

示例10: testBasicGettersSetters

 public function testBasicGettersSetters()
 {
     $user = new User();
     $user->setUsername('Toto');
     $user->setEmail('toto@tata.com');
     $user->setIsActive(false);
     $user->setPassword('1234');
     $this->assertEquals('Toto', $user->getUsername());
     $this->assertEquals('toto@tata.com', $user->getEmail());
     $this->assertEquals(false, $user->isActive());
     $this->assertEquals('1234', $user->getPassword());
 }
开发者ID:Pamoi,项目名称:photo-gallery-api,代码行数:12,代码来源:UserTest.php

示例11: transform

 /**
  * Transform a Model User to its representation.
  *
  * @param User|null $user
  *
  * @return UserRepresentation|null
  */
 public function transform($user)
 {
     if (!$user) {
         return;
     }
     $representation = new UserRepresentation();
     $representation->setId($user->getId());
     $representation->setUsername($user->getUsername());
     $representation->setEmail($user->getEmail());
     $representation->setFirstname($user->getFirstName());
     return $representation;
 }
开发者ID:bamlab,项目名称:Versioned-API-Tuto,代码行数:19,代码来源:UserTransformer.php

示例12: sendResettingEmailMessage

 /**
  * @param User $user
  */
 public function sendResettingEmailMessage(User $user)
 {
     /* Variables used in template */
     $confirmationToken = $user->getConfirmationToken();
     $username = $user->getUsername();
     /* END */
     /* Variables used in mail sending function */
     $subject = 'Resetowanie hasła';
     $email = $user->getEmail();
     $renderedTemplate = $this->templating->render('AppBundle:Emails:passwordResetting.html.twig', array('username' => $username, 'confirmationToken' => $confirmationToken));
     /* END */
     $this->sendEmailMessage($renderedTemplate, $subject, $email);
 }
开发者ID:bamper,项目名称:application,代码行数:16,代码来源:Mailer.php

示例13: __construct

 public function __construct(User $user)
 {
     $this->id = $user->getId();
     $this->firstname = $user->getFirstname();
     $this->lastname = $user->getLastname();
     $this->email = $user->getEmail();
     $this->positionLong = $user->getPositionLong();
     $this->positionLat = $user->getPositionLat();
     $this->positionCity = $user->getPositionCity();
     $this->positionDep = $user->getPositionDep();
     $this->positionCountry = $user->getPositionCountry();
     $this->photo = $user->getPhoto();
 }
开发者ID:gototog,项目名称:api-catwomap,代码行数:13,代码来源:UserDTO.php

示例14: __construct

 /**
  * UserModel constructor.
  * @param User $user
  */
 public function __construct(User $user)
 {
     $this->setId($user->getId());
     $this->setUsername($user->getUsername());
     $this->setUserFirstName($user->getUserFirstName());
     $this->setUserLastName($user->getUserLastName());
     $this->setEmail($user->getEmail());
     $this->setPassword($user->getPassword());
     $this->setApiKey($user->getApiKey());
     $role = $this->determineTheBiggestRole($user);
     if ($role) {
         $this->setRole(new RoleModel($role));
     }
 }
开发者ID:Gardax,项目名称:studentsSystem,代码行数:18,代码来源:UserModel.php

示例15: signupAction

 /**
  * @Route("/signup")
  * @Method({"GET", "POST"})
  * @Template
  */
 public function signupAction(Request $request)
 {
     $form = $this->createForm(new SignupType(), $user = new User());
     $form->handleRequest($request);
     if (!$form->isValid()) {
         return ['form' => $form->createView()];
     }
     $same = $this->repo('AppBundle:User')->findOneBy(['email' => $user->getEmail()]);
     if (null !== $same and $same->isConfirmed()) {
         $form->get('email')->addError(new FormError("Email {$user->getEmail()} is already confirmed"));
         return ['form' => $form->createView()];
     }
     if (null !== $same) {
         $this->get('mail')->user($same, 'activate_email', ['link' => $this->generateUrl('app_user_confirm', ['token' => $same->getConfirmationToken()], true)]);
         $this->addFlash('info', "Confirmation email was successfully resent to {$same->getEmail()}");
         return ['form' => $form->createView()];
     }
     $user->regenerateConfirmationToken();
     $this->persist($user);
     $this->flush();
     $this->get('mail')->user($user, 'activate_email', ['link' => $this->generateUrl('app_user_confirm', ['token' => $user->getConfirmationToken()], true)]);
     $this->addFlash('success', "You should receive confirmation email shortly");
     return $this->redirect($this->generateUrl('app_user_login'));
 }
开发者ID:vaidasif,项目名称:symfony-force,代码行数:29,代码来源:UserController.php


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