You are here

public function UnprocessableHttpEntityException::setViolations in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/Exception/UnprocessableHttpEntityException.php \Drupal\jsonapi\Exception\UnprocessableHttpEntityException::setViolations()
  2. 10 core/modules/jsonapi/src/Exception/UnprocessableHttpEntityException.php \Drupal\jsonapi\Exception\UnprocessableHttpEntityException::setViolations()

Sets the constraint violations associated with this exception.

Parameters

\Drupal\Core\Entity\EntityConstraintViolationListInterface $violations: The constraint violations.

File

core/modules/jsonapi/src/Exception/UnprocessableHttpEntityException.php, line 65

Class

UnprocessableHttpEntityException
A class to represent a 422 - Unprocessable Entity Exception.

Namespace

Drupal\jsonapi\Exception

Code

public function setViolations(EntityConstraintViolationListInterface $violations) {
  $this->violations = $violations;
}