public function __clone()
{
if ($this->parent === NULL) {
return;
} elseif ($this->parent instanceof Container) {
$this->parent = $this->parent->_isCloning();
if ($this->parent === NULL) {
// not cloning
$this->refreshMonitors(0);
}
} else {
$this->parent = NULL;
$this->refreshMonitors(0);
}
}
/** * Object cloning. */ public function __clone() { if ($this->components) { $oldMyself = reset($this->components)->getParent(); $oldMyself->cloning = $this; foreach ($this->components as $name => $component) { $this->components[$name] = clone $component; } $oldMyself->cloning = NULL; } parent::__clone(); }