Started to work on the possibilty to create new entities directly from the part edit page.

This fixes issue #203.
This commit is contained in:
Jan Böhmer 2023-01-29 20:42:18 +01:00
parent 672d55624f
commit 1654010ea3
8 changed files with 142 additions and 84 deletions

View file

@ -59,7 +59,8 @@ class ValidPartLotValidator extends ConstraintValidator
if ($value->getStorageLocation()) {
$repo = $this->em->getRepository(Storelocation::class);
//We can only determine associated parts, if the part have an ID
if (null !== $value->getID()) {
//When the storage location is new (no ID), we can just assume there are no other parts
if (null !== $value->getID() && $value->getStorageLocation()->getID()) {
$parts = new ArrayCollection($repo->getParts($value->getStorageLocation()));
} else {
$parts = new ArrayCollection([]);