PHP Class Neomerx\JsonApi\Exceptions\JsonApiException

Inheritance: extends RuntimeExceptio\RuntimeException
Mostra file Open project: neomerx/json-api Class Usage Examples

Public Methods

Method Description
__construct ( Neomerx\JsonApi\Contracts\Document\ErrorInterface | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection $errors, integer $httpCode = self::DEFAULT_HTTP_CODE, Exception $previous = null ) Constructor.
addError ( Neomerx\JsonApi\Contracts\Document\ErrorInterface $error )
addErrors ( ErrorCollection $errors ) : void
addErrorsFromArray ( array $errors ) : void
getErrors ( ) : ErrorCollection
getHttpCode ( ) : integer
throwException ( JsonApiException $exception )

Method Details

__construct() public method

Constructor.
public __construct ( Neomerx\JsonApi\Contracts\Document\ErrorInterface | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection $errors, integer $httpCode = self::DEFAULT_HTTP_CODE, Exception $previous = null )
$errors Neomerx\JsonApi\Contracts\Document\ErrorInterface | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection
$httpCode integer
$previous Exception

addError() public method

public addError ( Neomerx\JsonApi\Contracts\Document\ErrorInterface $error )
$error Neomerx\JsonApi\Contracts\Document\ErrorInterface

addErrors() public method

public addErrors ( ErrorCollection $errors ) : void
$errors ErrorCollection
return void

addErrorsFromArray() public method

public addErrorsFromArray ( array $errors ) : void
$errors array
return void

getErrors() public method

public getErrors ( ) : ErrorCollection
return ErrorCollection

getHttpCode() public method

public getHttpCode ( ) : integer
return integer

throwException() public static method

public static throwException ( JsonApiException $exception )
$exception JsonApiException