function ErrorCollection::__construct
Instantiates an ErrorCollection object.
Parameters
\Symfony\Component\HttpKernel\Exception\HttpExceptionInterface[] $errors: The errors.
File
-
core/
modules/ jsonapi/ src/ JsonApiResource/ ErrorCollection.php, line 37
Class
- ErrorCollection
- To be used when the primary data is `errors`.
Namespace
Drupal\jsonapi\JsonApiResourceCode
public function __construct(array $errors) {
assert(Inspector::assertAll(function ($error) {
return $error instanceof HttpExceptionInterface;
}, $errors));
$this->errors = $errors;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.