mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-24 02:39:33 +00:00
Merge "EventPresentationModel: Add accessor for current user's username"
This commit is contained in:
commit
72cb6202b0
|
@ -29,7 +29,7 @@ abstract class EchoEventPresentationModel {
|
||||||
/**
|
/**
|
||||||
* @param EchoEvent $event
|
* @param EchoEvent $event
|
||||||
* @param Language|string $language
|
* @param Language|string $language
|
||||||
* @param User $user Only used for permissions checking
|
* @param User $user Only used for permissions checking and GENDER
|
||||||
*/
|
*/
|
||||||
protected function __construct( EchoEvent $event, $language, User $user ) {
|
protected function __construct( EchoEvent $event, $language, User $user ) {
|
||||||
$this->event = $event;
|
$this->event = $event;
|
||||||
|
@ -131,6 +131,15 @@ abstract class EchoEventPresentationModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the viewing user's name for usage in GENDER
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
final protected function getViewingUserForGender() {
|
||||||
|
return $this->user->getName();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To be overridden by subclasses if they are unable to render the
|
* To be overridden by subclasses if they are unable to render the
|
||||||
* notification, for example when a page is deleted.
|
* notification, for example when a page is deleted.
|
||||||
|
|
Loading…
Reference in a new issue