mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-29 21:14:29 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
6caf605fe2
commit
e01b06fb85
80 changed files with 173 additions and 218 deletions
|
@ -104,20 +104,18 @@ class ValidPartLotValidator extends ConstraintValidator
|
|||
}
|
||||
|
||||
//Check for onlyExisting
|
||||
if ($value->getStorageLocation()->isLimitToExistingParts()) {
|
||||
if (!$parts->contains($value->getPart())) {
|
||||
$this->context->buildViolation('validator.part_lot.only_existing')
|
||||
->atPath('storage_location')->addViolation();
|
||||
}
|
||||
if ($value->getStorageLocation()->isLimitToExistingParts() && !$parts->contains($value->getPart())) {
|
||||
$this->context->buildViolation('validator.part_lot.only_existing')
|
||||
->atPath('storage_location')->addViolation();
|
||||
}
|
||||
|
||||
//Check for only single part
|
||||
if ($value->getStorageLocation()->isOnlySinglePart()) {
|
||||
if (($parts->count() > 0) && !$parts->contains($value->getPart())) {
|
||||
if ($value->getStorageLocation()->isOnlySinglePart() && ($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