Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4150643
NotificationsBatch.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
NotificationsBatch.php
View Options
<?php
namespace
MediaWiki\Notification
;
use
ArrayIterator
;
use
Countable
;
use
IteratorAggregate
;
/**
* An object representing notification with list of recipients
* @since 1.44
* @unstable
*/
class
NotificationsBatch
implements
Countable
,
IteratorAggregate
{
private
array
$envelopes
=
[];
public
function
__construct
(
NotificationEnvelope
...
$envelopes
)
{
$this
->
envelopes
=
$envelopes
;
}
public
function
add
(
NotificationEnvelope
$envelope
)
{
$this
->
envelopes
[]
=
$envelope
;
}
public
function
remove
(
NotificationEnvelope
$toRemove
)
{
$this
->
filter
(
static
function
(
NotificationEnvelope
$existing
)
use
(
$toRemove
)
{
return
!
$existing
->
equals
(
$toRemove
);
}
);
}
/**
* @param callable(NotificationEnvelope): bool $callback Filter, return true to preserve the $envelope
*/
public
function
filter
(
$callback
):
void
{
$this
->
envelopes
=
array_values
(
array_filter
(
$this
->
envelopes
,
$callback
)
);
}
public
function
count
():
int
{
return
count
(
$this
->
envelopes
);
}
/**
* @return ArrayIterator<NotificationEnvelope>
*/
public
function
getIterator
():
ArrayIterator
{
return
new
ArrayIterator
(
$this
->
envelopes
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 19:39 (6 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c4/3d/c55cd8745c4e2d500e3b4ac35599
Default Alt Text
NotificationsBatch.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment