<?phpnamespaceGuzzle\Http\Exception;
useGuzzle\Common\Exception\ExceptionCollection;
useGuzzle\Http\Message\RequestInterface;
/**
* Exception encountered during a multi transfer
*/class MultiTransferExceptionextends ExceptionCollection {
protected $successfulRequests = array();
protected $failedRequests = array();
/**
* Get all of the requests in the transfer
*
* @return array
*/
public functiongetAllRequests() {
returnarray_merge($this->successfulRequests, $this->failedRequests);
}
/**
* Add to the array of successful requests
*
* @param RequestInterface $request Successful request
*
* @return self
*/
public functionaddSuccessfulRequest(RequestInterface $request) {
$this->successfulRequests[] = $request;
return$this;
}
/**
* Add to the array of failed requests
*
* @param RequestInterface $request Failed request
*
* @return self
*/
public functionaddFailedRequest(RequestInterface $request) {
$this->failedRequests[] = $request;
return$this;
}
/**
* Set all of the successful requests
*
* @param array Array of requests
*
* @return self
*/
public functionsetSuccessfulRequests(array $requests) {
$this->successfulRequests = $requests;
return$this;
}
/**
* Set all of the failed requests
*
* @param array Array of requests
*
* @return self
*/
public functionsetFailedRequests(array $requests) {
$this->failedRequests = $requests;
return$this;
}
/**
* Get an array of successful requests sent in the multi transfer
*
* @return array
*/
public functiongetSuccessfulRequests() {
return$this->successfulRequests;
}
/**
* Get an array of failed requests sent in the multi transfer
*
* @return array
*/
public functiongetFailedRequests() {
return$this->failedRequests;
}
}