AbstractObject::__clone PHP Method

__clone() public method

Clones associated controller and model. If cloning views, add them to the owner.
public __clone ( ) : AbstractObject
return AbstractObject Copy of this object
    public function __clone()
    {
        if ($this->model && is_object($this->model)) {
            $this->model = clone $this->model;
        }
        if ($this->controller && is_object($this->controller)) {
            $this->controller = clone $this->controller;
        }
    }

Usage Example

 /** Duplicate view and it's template. Will not duplicate children */
 function __clone()
 {
     parent::__clone();
     if ($this->template) {
         $this->template = clone $this->template;
     }
 }
All Usage Examples Of AbstractObject::__clone