You are here

public function EntityConstraintViolationList::getByField in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php \Drupal\Core\Entity\EntityConstraintViolationList::getByField()

Gets the violations of the given field.

Parameters

string $field_name: The name of the field to get violations for.

Return value

\Symfony\Component\Validator\ConstraintViolationListInterface The violations of the given field.

Overrides EntityConstraintViolationListInterface::getByField

File

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

Class

EntityConstraintViolationList
Implements an entity constraint violation list.

Namespace

Drupal\Core\Entity

Code

public function getByField($field_name) {
  return $this
    ->getByFields([
    $field_name,
  ]);
}