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