mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-06 00:14:36 +02:00
Added the possibility to edit/create/delete part lots.
This commit is contained in:
parent
6a0adae8f3
commit
813e7dc85b
11 changed files with 226 additions and 43 deletions
|
@ -179,7 +179,8 @@ class Part extends AttachmentContainingDBElement
|
|||
|
||||
/**
|
||||
* @var ?PartLot[]
|
||||
* @ORM\OneToMany(targetEntity="PartLot", mappedBy="part")
|
||||
* @ORM\OneToMany(targetEntity="PartLot", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
protected $partLots;
|
||||
|
||||
|
@ -593,6 +594,18 @@ class Part extends AttachmentContainingDBElement
|
|||
return $this->partLots;
|
||||
}
|
||||
|
||||
public function addPartLot(PartLot $lot): Part
|
||||
{
|
||||
$lot->setPart($this);
|
||||
$this->partLots->add($lot);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePartLot(PartLot $lot): Part
|
||||
{
|
||||
$this->partLots->removeElement($lot);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the assigned manufacturer product number (MPN) for this part.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue