MediaWiki master
LimitBatchResult.php
Go to the documentation of this file.
1<?php
2
3namespace Wikimedia\WRStats;
4
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}
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.