mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Add accessor for bundled events in EventPresentationModel
The implementation of this sucks as the presentation model should not be making database queries. But the API it provides is what we want and will be supported even if the backend implementation is changed. Change-Id: Ifd0d11260990fd0e00e8f32eee273f9717d3e1fb
This commit is contained in:
parent
a00628b42a
commit
9057196d21
|
@ -80,6 +80,26 @@ abstract class EchoEventPresentationModel {
|
|||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return EchoEvent[]
|
||||
*/
|
||||
final protected function getBundledEvents() {
|
||||
if ( !$this->event->getBundleHash() ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
// FIXME: We really shouldn't be making db queries like this
|
||||
// in the presentation model
|
||||
$eventMapper = new EchoEventMapper();
|
||||
$events = $eventMapper->fetchByUserBundleHash(
|
||||
$this->user,
|
||||
$this->event->getBundleHash()
|
||||
// default params: web, DESC, limit=250
|
||||
);
|
||||
|
||||
return $events;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The symbolic icon name as defined in $wgEchoNotificationIcons
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue