mediawiki-extensions-Echo/includes/formatters/EchoModelFormatter.php
Matthias Mullie e7e55d4279 EchoModelFormatter extends EchoEventFormatter
There was no point in letting it extend EchoFlyoutFormatter instead
of the base EchoEventFormatter. The only things in EchoFlyoutFormatter
are formatModel & getIconURL, both of which aren't being called.

Change-Id: I89511530a41976974f4d51d55379a617dfe503ec
2016-01-17 22:26:34 -08:00

18 lines
494 B
PHP

<?php
/**
* A formatter for the notification flyout popup. Just the bare data needed to
* render everything client-side.
*/
class EchoModelFormatter extends EchoEventFormatter {
/**
* @param EchoEventPresentationModel $model
* @return array
*/
protected function formatModel( EchoEventPresentationModel $model ) {
$data = $model->jsonSerialize();
$data['iconUrl'] = EchoNotificationFormatter::getIconUrl( $model->getIconType(), $this->language->getDir() );
return $data;
}
}