mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-12 13:19:33 +00:00
Die IPN-Logik wurde um eine Konfiguration zur automatischen Suffix-Anfügung und die Berücksichtigung von doppelten Beschreibungen bei Bedarf ergänzt. Zudem wurde das Datenmodell angepasst, um eine eindeutige Speicherung der IPN zu gewährleisten.
22 lines
510 B
PHP
22 lines
510 B
PHP
<?php
|
|
|
|
namespace App\Validator\Constraints;
|
|
|
|
use Attribute;
|
|
use Symfony\Component\Validator\Constraint;
|
|
|
|
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY)]
|
|
class UniquePartIpnConstraint extends Constraint
|
|
{
|
|
public string $message = 'part.ipn.must_be_unique';
|
|
|
|
public function getTargets(): string|array
|
|
{
|
|
return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT];
|
|
}
|
|
|
|
public function validatedBy(): string
|
|
{
|
|
return UniquePartIpnValidator::class;
|
|
}
|
|
}
|