if (!
$result || (1 === \
count($result) &&
current($result) ===
$entity)) { return;
} $errorPath =
$constraint->errorPath ??
$fields[0
];
$invalidValue =
$criteria[$errorPath] ??
$criteria[$fields[0
]];
$this->context->
buildViolation($constraint->message
) ->
atPath($errorPath) ->
setParameter('{{ value }}',
$this->
formatWithIdentifiers($em,
$class,
$invalidValue)) ->
setInvalidValue($invalidValue) ->
setCode(UniqueEntity::NOT_UNIQUE_ERROR
) ->
setCause($result) ->
addViolation();
} private function ignoreNullForField(UniqueEntity
$constraint, string
$fieldName): bool
{ if (\
is_bool($constraint->ignoreNull
)) { return $constraint->ignoreNull;
}