當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。