mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 18:34:32 +02:00
parent
ccdac1a94b
commit
a3c626d0ab
8 changed files with 92 additions and 7 deletions
|
@ -348,4 +348,18 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if ($this->id) {
|
||||
$this->addedDate = null;
|
||||
$pricedetails = $this->pricedetails;
|
||||
$this->pricedetails = new ArrayCollection();
|
||||
//Set master attachment is needed
|
||||
foreach ($pricedetails as $pricedetail) {
|
||||
$this->addPricedetail(clone $pricedetail);
|
||||
}
|
||||
}
|
||||
parent::__clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -328,4 +328,12 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
|
|||
{
|
||||
return 'PD'.sprintf('%06d', $this->getID());
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if ($this->id) {
|
||||
$this->addedDate = null;
|
||||
}
|
||||
parent::__clone();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue