function EntityConstraintViolationList::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php \Drupal\Core\Entity\EntityConstraintViolationList::__construct()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php \Drupal\Core\Entity\EntityConstraintViolationList::__construct()
  3. 11.x core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php \Drupal\Core\Entity\EntityConstraintViolationList::__construct()

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity that has been validated.

array $violations: The array of violations.

File

core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 50

Class

EntityConstraintViolationList
Implements an entity constraint violation list.

Namespace

Drupal\Core\Entity

Code

public function __construct(FieldableEntityInterface $entity, array $violations = []) {
    parent::__construct($violations);
    $this->entity = $entity;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.