class UnprocessableHttpEntityException extends HttpException (View source)

internal  JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it.
 

A class to represent a 422 - Unprocessable Entity Exception.

The HTTP 422 status code is used when the server sees:-

The content type of the request is correct. The syntax of the request is correct. BUT was unable to process the contained instruction.

Traits

Provides dependency injection friendly methods for serialization.

Properties

protected array $_serviceIds

An array of service IDs keyed by property name used for serialization.

from  DependencySerializationTrait
protected array $_entityStorages

An array of entity type IDs keyed by the property name of their storages.

from  DependencySerializationTrait
protected EntityConstraintViolationListInterface $violations

The constraint violations associated with this exception.

Methods

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

__construct(Exception $previous = NULL, array $headers = [], int $code = 0)

UnprocessableHttpEntityException constructor.

getViolations()

Gets the constraint violations associated with this exception.

setViolations(EntityConstraintViolationListInterface $violations)

Sets the constraint violations associated with this exception.

Details

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

__construct(Exception $previous = NULL, array $headers = [], int $code = 0)

UnprocessableHttpEntityException constructor.

Parameters

Exception $previous

The pervious error, if any, associated with the request.

array $headers

The headers associated with the request.

int $code

The HTTP status code associated with the request. Defaults to zero.

EntityConstraintViolationListInterface getViolations()

Gets the constraint violations associated with this exception.

Return Value

EntityConstraintViolationListInterface

The constraint violations.

setViolations(EntityConstraintViolationListInterface $violations)

Sets the constraint violations associated with this exception.

Parameters

EntityConstraintViolationListInterface $violations

The constraint violations.