// Keep the composite field if it covers some remaining field and put
// a violation on some other covered field instead.
if ($remaining_fields =
array_diff($covered_fields,
$field_names)) { $message_params =
['%field_name' =>
$field_name];
$violation =
new ConstraintViolation( $this->
t('The validation failed because the value conflicts with the value in %field_name, which you cannot access.',
$message_params),
'The validation failed because the value conflicts with the value in %field_name, which you cannot access.',
$message_params,
$violation->
getRoot(),
reset($remaining_fields),
$violation->
getInvalidValue(),
$violation->
getPlural(),
$violation->
getCode(),
$violation->
getConstraint(),
$violation->
getCause() );
$new_violations[] =
$violation;
} } $this->
remove($offset);
} }