MediaWiki
master
Toggle main menu visibility
LimitBatchResult.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Wikimedia\WRStats;
4
10
class
LimitBatchResult
{
12
private
$results;
13
15
private
$allowed;
16
21
public
function
__construct
( $results ) {
22
$this->results = $results;
23
}
24
30
public
function
isAllowed
() {
31
if
( $this->allowed ===
null
) {
32
$this->allowed =
true
;
33
foreach
( $this->results as $result ) {
34
if
( !$result->isAllowed() ) {
35
$this->allowed =
false
;
36
break
;
37
}
38
}
39
}
40
return
$this->allowed;
41
}
42
51
public
function
getFailedResults
() {
52
$failed = [];
53
foreach
( $this->results as $i => $result ) {
54
if
( !$result->isAllowed() ) {
55
$failed[$i] = $result;
56
}
57
}
58
return
$failed;
59
}
60
69
public
function
getPassedResults
() {
70
$passed = [];
71
foreach
( $this->results as $i => $result ) {
72
if
( $result->isAllowed() ) {
73
$passed[$i] = $result;
74
}
75
}
76
return
$passed;
77
}
78
87
public
function
getAllResults
() {
88
return
$this->results;
89
}
90
}
Wikimedia\WRStats\LimitBatchResult
A class representing the results from a batch operation.
Definition
LimitBatchResult.php:10
Wikimedia\WRStats\LimitBatchResult\__construct
__construct( $results)
Definition
LimitBatchResult.php:21
Wikimedia\WRStats\LimitBatchResult\getFailedResults
getFailedResults()
Get LimitOperationResult objects for operations exceeding the limit.
Definition
LimitBatchResult.php:51
Wikimedia\WRStats\LimitBatchResult\isAllowed
isAllowed()
Determine whether the batch as a whole is/was allowed.
Definition
LimitBatchResult.php:30
Wikimedia\WRStats\LimitBatchResult\getPassedResults
getPassedResults()
Get LimitOperationResult objects for operations not exceeding the limit.
Definition
LimitBatchResult.php:69
Wikimedia\WRStats\LimitBatchResult\getAllResults
getAllResults()
Get LimitOperationResult objects for all operations in the batch.
Definition
LimitBatchResult.php:87
Wikimedia\WRStats\LimitOperationResult
Information about the result of a single item in a limit batch.
Definition
LimitOperationResult.php:10
includes
libs
WRStats
LimitBatchResult.php
Generated on
for MediaWiki by
1.18.0