Example #1
0
 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;
     }
 }
Example #2
0
 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();
 }