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