Release 2.0.9 (#3922)
* fix api definition * include customer number in validation message * fix doctrine deprecation, prepare for DBAL 4 * added DataSubscriberInterface to identify certain doctrine subscribers
This commit is contained in:
@@ -17,7 +17,7 @@ final class Customer extends Constraint
|
||||
public const CUSTOMER_NUMBER_EXISTING = 'kimai-customer-00';
|
||||
|
||||
protected const ERROR_NAMES = [
|
||||
self::CUSTOMER_NUMBER_EXISTING => 'This account number is already used.',
|
||||
self::CUSTOMER_NUMBER_EXISTING => 'The account number %number% is already used.',
|
||||
];
|
||||
|
||||
public string $message = 'This customer has invalid settings.';
|
||||
|
||||
@@ -40,6 +40,7 @@ final class CustomerValidator extends ConstraintValidator
|
||||
$tmp = $this->customerRepository->findOneBy(['number' => $number]);
|
||||
if ($tmp !== null && $tmp->getId() !== $value->getId()) {
|
||||
$this->context->buildViolation(Customer::getErrorName(Customer::CUSTOMER_NUMBER_EXISTING))
|
||||
->setParameter('%number%', $number)
|
||||
->atPath('number')
|
||||
->setTranslationDomain('validators')
|
||||
->setCode(Customer::CUSTOMER_NUMBER_EXISTING)
|
||||
|
||||
Reference in New Issue
Block a user