implements max holder and validation on UI

This commit is contained in:
2021-06-11 17:58:09 +02:00
parent af740fd87d
commit 807d3674fc
8 changed files with 50 additions and 38 deletions

View File

@@ -12,4 +12,8 @@ class MaxHolder extends Constraint
public $message = 'household.max_holder_overflowed';
public $messageInfinity = 'household.max_holder_overflowed_infinity';
public function getTargets()
{
return self::CLASS_CONSTRAINT;
}
}

View File

@@ -31,7 +31,7 @@ class MaxHolderValidator extends ConstraintValidator
if ($covers->hasIntersections()) {
foreach ($covers->getIntersections() as list($start, $end, $ids)) {
$msg = $end === null ? $constraint->messageEndInfinite :
$msg = $end === null ? $constraint->messageInfinity :
$constraint->message;
$this->context->buildViolation($msg)