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();
|
||||
}
|
||||
|
||||
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.
|
||||
*****************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue