コード例 #1
0
ファイル: Component.php プロジェクト: mesour/components
 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;
     }
 }
コード例 #2
0
ファイル: Container.php プロジェクト: mesour/components
 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();
 }