• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Model\UserInterface类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: sendConfirmationEmailMessage

 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['confirmation.template'];
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => str_replace('%23', '#', $url)));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
开发者ID:rommsen,项目名称:plesynd,代码行数:7,代码来源:Mailer.php


示例17: withEntity

 /**
  * @param UserInterface $user
  * @return UserDTO
  */
 public static function withEntity(UserInterface $user)
 {
     $dto = new UserDTO();
     $dto->setId($user->getId());
     $dto->setEmail($user->getEmail());
     $dto->setApiKey($user->getApiKey());
     return $dto;
 }
开发者ID:sfarkas1988,项目名称:timekeepingAPI,代码行数:12,代码来源:UserDTO.php


示例18: updatePassword

 /**
  * {@inheritDoc}
  */
 public function updatePassword(UserInterface $user)
 {
     if ($user instanceof UserWrapped) {
         parent::updatePassword($user->getInterfacedUser());
         return;
     }
     parent::updatePassword($user);
 }
开发者ID:Novactive,项目名称:NovaeZFOSUserBundle,代码行数:11,代码来源:UserManager.php


示例19: sendResettingEmailMessage

 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('sonata_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $email = key($this->parameters['from_email']['resetting']);
     $context = array('user' => $user, 'confirmationUrl' => $url, 'ttl' => $this->parameters['ttl'], 'email' => $email, 'administrator' => $this->parameters['from_email']['resetting'][$email], 'request' => $this->requestStack->getCurrentRequest());
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
开发者ID:bruery,项目名称:platform,代码行数:8,代码来源:Mailer.php


示例20: getObfuscatedEmail

 /**
  * Get the truncated email displayed when requesting the resetting.
  *
  * The default implementation only keeps the part following @ in the address.
  *
  * @param \FOS\UserBundle\Model\UserInterface $user
  *
  * @return string
  */
 protected function getObfuscatedEmail(UserInterface $user)
 {
     $email = $user->getEmail();
     if (false !== ($pos = strpos($email, '@'))) {
         $email = '...' . substr($email, $pos);
     }
     return $email;
 }
开发者ID:kapilpatel20,项目名称:bvrolepermission,代码行数:17,代码来源:ResettingController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Model\UserManagerInterface类代码示例发布时间:2022-05-23
下一篇:
PHP Model\User类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap