public function __clone() { if ($this->parent === null) { return; } elseif ($this->parent instanceof Container && $this->parent->_isCloning()) { $this->attached($this->parent->_isCloning()); } else { $this->parent = null; } }
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(); }