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


PHP Model\UserInterface类代码示例

本文整理汇总了PHP中FOS\UserBundle\Model\UserInterface的典型用法代码示例。如果您正苦于以下问题:PHP UserInterface类的具体用法?PHP UserInterface怎么用?PHP UserInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: sendEmailMessage

 public function sendEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['new'];
     $url = $this->router->generate('fos_user_registration_confirm_email', ['token' => $user->getConfirmationToken(), 'email' => $user->getEmail()], true);
     $context = ['user' => $user, 'confirmationUrl' => $url];
     $this->sendMessage($template, $context, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
开发者ID:rotanov,项目名称:fefu-social-network,代码行数:7,代码来源:TwigSwiftMailer.php

示例2: onSuccess

 protected function onSuccess(UserInterface $user)
 {
     $user->setPlainPassword($this->getNewPassword());
     $user->setConfirmationToken(null);
     $user->setEnabled(true);
     $this->userManager->updateUser($user);
 }
开发者ID:Anmoldev,项目名称:FOSUserBundle,代码行数:7,代码来源:ResettingFormHandler.php

示例3: sendResettingEmailMessage

 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['resetting.template'];
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
开发者ID:jjspider277,项目名称:weddings,代码行数:7,代码来源:Mailer.php

示例4: onSuccess

 protected function onSuccess(UserInterface $user, $confirmation)
 {
     $user->setPasskey(md5(uniqid()));
     $user->setDateAdded(new \DateTime('now'));
     $user->setLastActivity(new \DateTime('now'));
     parent::onSuccess($user, $confirmation);
 }
开发者ID:superskat,项目名称:tracker,代码行数:7,代码来源:RegistrationFormHandler.php

示例5: sendInvitationEmail

 /**
  * {@inheritdoc}
  */
 public function sendInvitationEmail(UserInterface $user)
 {
     $template = $this->parameters['invitation.template'];
     $url = $this->router->generate('kreta_user_registration', ['token' => $user->getConfirmationToken()], true);
     $rendered = $this->templating->render($template, ['user' => $user, 'registerUrl' => $url]);
     $this->sendEmailMessage($rendered, self::KRETA_INVITATION_EMAIL, $user->getEmail());
 }
开发者ID:dasklney,项目名称:kreta,代码行数:10,代码来源:Mailer.php

示例6: sendResettingEmailMessage

 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->getTemplate('resetting');
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'confirmationUrl' => $url);
     return $this->sendMessage($template, $context, $this->getFromEmail('resetting'), $user->getEmail());
 }
开发者ID:polifonic,项目名称:FOSUserBundle,代码行数:7,代码来源:TwigSwiftMailer.php

示例7: reloadUser

 /**
  * {@inheritDoc}
  */
 public function reloadUser(UserInterface $user)
 {
     if (!$user instanceof \Persistent) {
         throw new \InvalidArgumentException('This user instance is not supported by the Propel UserManager implementation');
     }
     $user->reload();
 }
开发者ID:Dren-x,项目名称:mobitnew,代码行数:10,代码来源:UserManager.php

示例8: sendResettingEmailMessage

 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), UrlGeneratorInterface::ABSOLUTE_URL);
     $context = array('user' => $user, 'confirmationUrl' => $url);
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
开发者ID:yoannfleurydev,项目名称:amicale-src,代码行数:7,代码来源:TwigSwiftMailer.php

示例9: onSuccess

 /**
  * @param UserInterface $user
  */
 protected function onSuccess(UserInterface $user)
 {
     if ($this->getNewPassword() != "") {
         $user->setPlainPassword($this->getNewPassword());
     }
     $this->userManager->updateUser($user);
 }
开发者ID:Tagarela76,项目名称:table4you,代码行数:10,代码来源:ProfileFormHandler.php

示例10: sendMail

 /**
  * @param UserInterface $user
  * @param string $subject
  * @param string $body
  */
 private function sendMail(UserInterface $user, $subject, $body)
 {
     $message = $this->mailer->createMessage();
     $to = array($user->getEmail() => $user->getUsername());
     $message = $message->setSubject($subject)->addFrom($this->mailSender, $this->mailSenderName)->setTo($to)->setBody($body, 'text/html');
     $this->mailer->send($message);
 }
开发者ID:ulakjira,项目名称:ojs,代码行数:12,代码来源:UserEventListener.php

示例11: sendCreationEmailMessage

 /**
  * {@inheritdoc}
  */
 public function sendCreationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['creation.template'];
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), UrlGeneratorInterface::ABSOLUTE_URL);
     $rendered = $this->templating->render($template, array('user' => $user, 'password' => $user->getPlainPassword(), 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['creation'], $user->getEmail());
 }
开发者ID:tkuska,项目名称:user,代码行数:10,代码来源:Mailer.php

示例12: sendResettingEmailMessage

 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('get_reset_resetting', array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'confirmationUrl' => str_replace('api', '#', $url));
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
开发者ID:norkazuleta,项目名称:proyectoServer,代码行数:7,代码来源:TwigSwiftMailer.php

示例13: sendResettingEmailMessage

 public function sendResettingEmailMessage(UserInterface $user, $engine)
 {
     $template = $this->parameters['resetting_password.template'];
     $url = $this->router->generate('fos_user_user_reset_password', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template . '.txt.' . $engine, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->getSenderEmail('resetting_password'), $user->getEmail());
 }
开发者ID:KnpLabs,项目名称:KnpUserBundle,代码行数:7,代码来源:Mailer.php

示例14: storeDateTimeSettingsInSession

 /**
  * Make user date and time settings sticky
  *
  * @param UserInterface $user
  * @param SessionInterface $session
  */
 protected function storeDateTimeSettingsInSession(UserInterface $user, SessionInterface $session)
 {
     $session->set('campaignchain.locale', $user->getLocale());
     $session->set('campaignchain.timezone', $user->getTimezone());
     $session->set('campaignchain.dateFormat', $user->getDateFormat());
     $session->set('campaignchain.timeFormat', $user->getTimeFormat());
 }
开发者ID:CampaignChain,项目名称:core,代码行数:13,代码来源:UserDateTimeListener.php

示例15: getPrincipalArray

 /**
  * get Array with Principal-Data from User-Object.
  *
  * @param UserInterface|GroupInterface $principalObject
  * @param bool                         $show_id
  *
  * @return array
  *
  * @throws Exception
  */
 private function getPrincipalArray($principalObject, $show_id = false)
 {
     if (!$principalObject instanceof UserInterface && !$principalObject instanceof GroupInterface) {
         throw new Exception('$principalObject must be of type UserInterface of GroupInterface');
     }
     $principal = array();
     if ($show_id) {
         $principal['id'] = $principalObject->getId();
     }
     if ($principalObject instanceof UserInterface) {
         $principal['uri'] = 'principals/' . $principalObject->getUsername();
     } else {
         $principal['uri'] = 'principals/' . $principalObject->getName();
     }
     // get all fields from $this->fieldMap, additional to 'uri' and 'id'
     foreach ($this->fieldMap as $key => $value) {
         if (!method_exists($principalObject, $value['getter'])) {
             continue;
         }
         $valueGetter = call_user_func(array($principalObject, $value['getter']));
         if ($valueGetter) {
             $principal[$key] = $valueGetter;
         }
     }
     return $principal;
 }
开发者ID:bartv2,项目名称:SecotrustSabreDavBundle,代码行数:36,代码来源:PrincipalBackend.php


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