mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-07 11:39:30 +00:00
Perform the duplicate check of parameter names already on initial creation
This fixes issue #568
This commit is contained in:
parent
dfe4568991
commit
b70d74ae4b
4 changed files with 12 additions and 2 deletions
|
|
@ -54,6 +54,7 @@ use App\Entity\Parts\PartTraits\OrderTrait;
|
|||
use App\Entity\Parts\PartTraits\ProjectTrait;
|
||||
use App\EntityListeners\TreeCacheInvalidationListener;
|
||||
use App\Repository\PartRepository;
|
||||
use App\Validator\Constraints\UniqueObjectCollection;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
|
@ -119,6 +120,7 @@ class Part extends AttachmentContainingDBElement
|
|||
#[Groups(['full', 'part:read', 'part:write'])]
|
||||
#[ORM\OneToMany(mappedBy: 'element', targetEntity: PartParameter::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['group' => 'ASC', 'name' => 'ASC'])]
|
||||
#[UniqueObjectCollection(fields: ['name', 'group', 'element'])]
|
||||
protected Collection $parameters;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue