Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
EchoArticleReminderPresentationModel | |
0.00% |
0 / 9 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
canRender | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getIconType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getHeaderMessage | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getPrimaryLink | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\Notifications\Formatters; |
4 | |
5 | /** |
6 | * Presenter for 'article-reminder' notification |
7 | * |
8 | * @author Ela Opper |
9 | * |
10 | * @license MIT |
11 | */ |
12 | class EchoArticleReminderPresentationModel extends EchoEventPresentationModel { |
13 | public function canRender() { |
14 | return (bool)$this->event->getTitle(); |
15 | } |
16 | |
17 | public function getIconType() { |
18 | return 'article-reminder'; |
19 | } |
20 | |
21 | public function getHeaderMessage() { |
22 | $msg = $this->getMessageWithAgent( 'notification-header-article-reminder' ); |
23 | $msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) ); |
24 | return $msg; |
25 | } |
26 | |
27 | public function getPrimaryLink() { |
28 | return [ |
29 | 'url' => $this->event->getTitle()->getLocalURL(), |
30 | 'label' => $this->msg( 'notification-link-article-reminder' )->text(), |
31 | ]; |
32 | } |
33 | } |