本文整理汇总了PHP中Notification::getSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::getSubject方法的具体用法?PHP Notification::getSubject怎么用?PHP Notification::getSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::getSubject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendNotification
public function sendNotification(Notification $notification, $notifiers = array())
{
if (!empty($notifiers)) {
$notifiers = array_filter($this->notifiers, function ($notifier) use($notifiers) {
return in_array($notifier->getNotifierKey(), $notifiers);
});
} else {
$notifiers = $this->notifiers;
}
foreach ($notifiers as $notifier) {
$notifier->notify($notification->getUser(), $notification->getView(), $notification->getViewData(), $notification->getSubject());
}
}
示例2: buildEmail
private function buildEmail(Project $project, Notification $notification, MailEnhancer $mail_enhancer, $email)
{
$mail = $this->getMailSender();
$mail->setFrom(ForgeConfig::get('sys_noreply'));
$mail->setTo($email);
if ($project->getTruncatedEmailsUsage()) {
$presenter = new MailPresenter($notification->getServiceName(), $notification->getGotoLink(), ForgeConfig::get('sys_fullname'));
$mail->setSubject($this->renderer->renderToString(self::TRUNCATED_SUBJECT_TEMPLATE, $presenter));
$mail->setBodyHtml($this->renderer->renderToString(self::TRUNCATED_BODY_TEMPLATE, $presenter));
} else {
$mail_enhancer->enhanceMail($mail);
if ($notification->hasHTMLBody()) {
$mail->setBodyHtml($notification->getHTMLBody());
}
if ($notification->hasTextBody()) {
$mail->setBodyText($notification->getTextBody());
}
$mail->setSubject($notification->getSubject());
}
return $mail;
}
示例3: testGetSubject
/**
* @covers Notification::getSubject
*/
public function testGetSubject()
{
$this->notification->setSubject("Conversation");
$actual = $this->notification->getSubject();
$this->assertEquals("Conversation", $actual);
}