Merge "EventPresentationModel: Add accessor for current user's username"

This commit is contained in:
jenkins-bot 2015-11-12 23:58:10 +00:00 committed by Gerrit Code Review
commit 72cb6202b0

View file

@ -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.