Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7409738
EchoModelFormatter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1023 B
Referenced Files
None
Subscribers
None
EchoModelFormatter.php
View Options
<?php
namespace
MediaWiki\Extension\Notifications\Formatters
;
use
MediaWiki\MediaWikiServices
;
/**
* A formatter for the notification flyout popup. Just the bare data needed to
* render everything client-side.
*/
class
EchoModelFormatter
extends
EchoEventFormatter
{
protected
function
formatModel
(
EchoEventPresentationModel
$model
):
array
{
$data
=
$model
->
jsonSerialize
();
$data
[
'iconUrl'
]
=
EchoIcon
::
getUrl
(
$model
->
getIconType
(),
$this
->
language
->
getDir
()
);
$urlUtils
=
MediaWikiServices
::
getInstance
()->
getUrlUtils
();
if
(
isset
(
$data
[
'links'
][
'primary'
][
'url'
]
)
)
{
$data
[
'links'
][
'primary'
][
'url'
]
=
$urlUtils
->
expand
(
$data
[
'links'
][
'primary'
][
'url'
]
);
}
// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
foreach
(
$data
[
'links'
][
'secondary'
]
as
&
$link
)
{
$link
[
'url'
]
=
$urlUtils
->
expand
(
$link
[
'url'
]
??
''
);
}
unset
(
$link
);
$bundledIds
=
$model
->
getBundledIds
();
if
(
$bundledIds
)
{
$data
[
'bundledIds'
]
=
$bundledIds
;
}
return
$data
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 22:37 (1 d, 21 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
49/c7/f41626e9aa451c47e7bf98b1fa11
Default Alt Text
EchoModelFormatter.php (1023 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment