mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02:00
parent
c0b4172f22
commit
a3af55d4e2
2 changed files with 20 additions and 0 deletions
|
@ -107,6 +107,19 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
|
||||||
$this->parameters = new ArrayCollection();
|
$this->parameters = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __clone()
|
||||||
|
{
|
||||||
|
if ($this->id) {
|
||||||
|
//Deep clone parameters
|
||||||
|
$parameters = $this->parameters;
|
||||||
|
$this->parameters = new ArrayCollection();
|
||||||
|
foreach ($parameters as $parameter) {
|
||||||
|
$this->addParameter(clone $parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parent::__clone();
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* StructuralDBElement constructor.
|
* StructuralDBElement constructor.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
|
@ -165,6 +165,13 @@ class Part extends AttachmentContainingDBElement
|
||||||
foreach ($orderdetails as $orderdetail) {
|
foreach ($orderdetails as $orderdetail) {
|
||||||
$this->addOrderdetail(clone $orderdetail);
|
$this->addOrderdetail(clone $orderdetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Deep clone parameters
|
||||||
|
$parameters = $this->parameters;
|
||||||
|
$this->parameters = new ArrayCollection();
|
||||||
|
foreach ($parameters as $parameter) {
|
||||||
|
$this->addParameter(clone $parameter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
parent::__clone();
|
parent::__clone();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue