Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5989218
EchoModelFormatter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
EchoModelFormatter.php
View Options
<?php
namespace
MediaWiki\Extension\Notifications\Formatters
;
/**
* 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
):
array
{
$data
=
$model
->
jsonSerialize
();
$data
[
'iconUrl'
]
=
EchoIcon
::
getUrl
(
$model
->
getIconType
(),
$this
->
language
->
getDir
()
);
if
(
isset
(
$data
[
'links'
][
'primary'
][
'url'
]
)
)
{
$data
[
'links'
][
'primary'
][
'url'
]
=
wfExpandUrl
(
$data
[
'links'
][
'primary'
][
'url'
]
);
}
// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
foreach
(
$data
[
'links'
][
'secondary'
]
as
&
$link
)
{
// @phan-suppress-next-line PhanTypeMismatchDimAssignment
$link
[
'url'
]
=
wfExpandUrl
(
$link
[
'url'
]
);
}
unset
(
$link
);
$bundledIds
=
$model
->
getBundledIds
();
if
(
$bundledIds
)
{
$data
[
'bundledIds'
]
=
$bundledIds
;
}
return
$data
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Oct 4, 01:03 (3 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c9/55/4da4b0ffc549ef4a8f613dd50dac
Default Alt Text
EchoModelFormatter.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment