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


PHP PFUser::getLanguage方法代码示例

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


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

示例1: buildMessage

 /**
  * Build the reminder messages
  *
  * @param Tracker_DateReminder $reminder Reminder that will send notifications
  * @param Tracker_Artifact $artifact Artifact for which reminders will be sent
  * @param Array            $messages Messages
  * @param PFUser             $user     Receipient
  *
  * return Array
  */
 protected function buildMessage(Tracker_DateReminder $reminder, Tracker_Artifact $artifact, &$messages, $user)
 {
     $mailManager = new MailManager();
     $recipient = $user->getEmail();
     $lang = $user->getLanguage();
     $format = $mailManager->getMailPreferencesByUser($user);
     //We send multipart mail: html & text body in case of preferences set to html
     $htmlBody = '';
     if ($format == Codendi_Mail_Interface::FORMAT_HTML) {
         $htmlBody .= $this->getBodyHtml($reminder, $artifact, $user, $lang);
     }
     $txtBody = $this->getBodyText($reminder, $artifact, $user, $lang);
     $subject = $this->getSubject($reminder, $artifact, $user);
     $headers = array();
     $hash = md5($htmlBody . $txtBody . serialize($headers) . serialize($subject));
     if (isset($messages[$hash])) {
         $messages[$hash]['recipients'][] = $recipient;
     } else {
         $messages[$hash] = array('headers' => $headers, 'htmlBody' => $htmlBody, 'txtBody' => $txtBody, 'subject' => $subject, 'recipients' => array($recipient));
     }
 }
开发者ID:ansarbek,项目名称:tuleap,代码行数:31,代码来源:Tracker_DateReminderManager.class.php

示例2: MockBaseLanguageFactory

 function testGetLanguageShouldUserLanguageFactoryIfNotDefined()
 {
     $langFactory = new MockBaseLanguageFactory();
     $langFactory->expectOnce('getBaseLanguage', array('fr_BE'));
     $user = new PFUser(array('language_id' => 'fr_BE'));
     $user->setLanguageFactory($langFactory);
     $user->getLanguage();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:UserTest.php


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