jenkins-bot has submitted this change and it was merged. Change subject: Add accessor for bundled events in EventPresentationModel ......................................................................
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 --- M includes/formatters/EventPresentationModel.php 1 file changed, 20 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/formatters/EventPresentationModel.php b/includes/formatters/EventPresentationModel.php index 2d2f8bb..2245f73 100644 --- a/includes/formatters/EventPresentationModel.php +++ b/includes/formatters/EventPresentationModel.php @@ -81,6 +81,26 @@ } /** + * @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 */ abstract public function getIconType(); -- To view, visit https://gerrit.wikimedia.org/r/254166 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd0d11260990fd0e00e8f32eee273f9717d3e1fb Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Sbisson <sbis...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits