mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Moved getParts() and getPartsCount() to a repository (instead of a class method).
This commit is contained in:
parent
350f1bb979
commit
14adb77a97
24 changed files with 421 additions and 71 deletions
|
@ -43,6 +43,7 @@ declare(strict_types=1);
|
|||
namespace App\Validator\Constraints;
|
||||
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
@ -75,7 +76,8 @@ class ValidPartLotValidator extends ConstraintValidator
|
|||
|
||||
//We can only validate the values if we know the storelocation
|
||||
if ($value->getStorageLocation()) {
|
||||
$parts = $value->getStorageLocation()->getParts();
|
||||
$repo = $this->em->getRepository(Storelocation::class);
|
||||
$parts = $repo->getParts($value);
|
||||
|
||||
//Check for isFull() attribute
|
||||
if ($value->getStorageLocation()->isFull()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue