mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
parent
f32ae8bc6c
commit
50cca40f77
9 changed files with 998 additions and 928 deletions
|
@ -80,7 +80,7 @@ class ValidPartLotValidator extends ConstraintValidator
|
|||
$repo = $this->em->getRepository(Storelocation::class);
|
||||
//We can only determine associated parts, if the part have an ID
|
||||
if ($value->getID() !== null) {
|
||||
$parts = new ArrayCollection($repo->getParts($value));
|
||||
$parts = new ArrayCollection($repo->getParts($value->getStorageLocation()));
|
||||
} else {
|
||||
$parts = new ArrayCollection([]);
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ class ValidPartLotValidator extends ConstraintValidator
|
|||
}
|
||||
|
||||
//Check for only single part
|
||||
if ($value->getStorageLocation()->isLimitToExistingParts()) {
|
||||
if ($value->getStorageLocation()->isOnlySinglePart()) {
|
||||
if (($parts->count() > 0) && ! $parts->contains($value->getPart())) {
|
||||
$this->context->buildViolation('validator.part_lot.single_part')
|
||||
->atPath('storage_location')->addViolation();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue