本文整理汇总了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();
}
示例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;
}
示例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();
}
}
}
示例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()));
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
示例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());
}
示例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());
}
示例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;
}
示例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);
}
示例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();
}
示例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));
}
}
示例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'));
}