Renamed Storelocation entity to StorageLocation

This commit is contained in:
Jan Böhmer 2023-09-04 22:57:40 +02:00
parent 09acca950d
commit 0af5a58dbe
59 changed files with 218 additions and 176 deletions

View file

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace App\Validator\Constraints;
use App\Entity\Parts\PartLot;
use App\Entity\Parts\Storelocation;
use App\Entity\Parts\StorageLocation;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
@ -53,8 +53,8 @@ class ValidPartLotValidator extends ConstraintValidator
}
//We can only validate the values if we know the storelocation
if ($value->getStorageLocation() instanceof Storelocation) {
$repo = $this->em->getRepository(Storelocation::class);
if ($value->getStorageLocation() instanceof StorageLocation) {
$repo = $this->em->getRepository(StorageLocation::class);
//We can only determine associated parts, if the part have an ID
//When the storage location is new (no ID), we can just assume there are no other parts
if (null !== $value->getID() && $value->getStorageLocation()->getID()) {