first commit
This commit is contained in:
30
plugins/stEservice2Plugin/vendor/eservice-sdk/lib/Response/Error.php
vendored
Normal file
30
plugins/stEservice2Plugin/vendor/eservice-sdk/lib/Response/Error.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Eservice;
|
||||
|
||||
class ResponseError extends Response
|
||||
{
|
||||
|
||||
protected $_errors = [];
|
||||
|
||||
public function __construct($response, $request, $info = [])
|
||||
{
|
||||
parent::__construct($response, $info);
|
||||
$this->_errors = new ResponseErrorErrors($this->data["errors"]);
|
||||
$this->_request = $request;
|
||||
}
|
||||
|
||||
public function get_error($name = null)
|
||||
{
|
||||
if (!is_null($name)) {
|
||||
if (isset($this->errors->{$name})) {
|
||||
return $this->errors->{$name};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user