mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 05:39:33 +00:00
20 lines
389 B
PHP
20 lines
389 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Validator\Constraints;
|
||
|
|
|
||
|
|
use Symfony\Component\Validator\Constraint;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @Annotation
|
||
|
|
* @Target({"PROPERTY"})
|
||
|
|
*/
|
||
|
|
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||
|
|
class UniquePartIpnConstraint extends Constraint
|
||
|
|
{
|
||
|
|
public string $message = 'part.ipn.must_be_unique';
|
||
|
|
|
||
|
|
public function validatedBy(): string
|
||
|
|
{
|
||
|
|
return UniquePartIpnValidator::class;
|
||
|
|
}
|
||
|
|
}
|