AbstractObject::destroy PHP Method

destroy() public method

Removes object from parent and prevents it from rendering \code $view = $this->add('View'); $view -> destroy(); \endcode.
public destroy ( $recursive = true )
    public function destroy($recursive = true)
    {
        if ($recursive) {
            foreach ($this->elements as $el) {
                if ($el instanceof self) {
                    $el->destroy();
                }
            }
        }
        /*
        if (@$this->model && $this->model instanceof AbstractObject) {
            $this->model->destroy();
            unset($this->model);
        }
        if (@$this->controller && $this->controller instanceof AbstractObject) {
            $this->controller->destroy();
            unset($this->controller);
        }
        */
        $this->owner->_removeElement($this->short_name);
    }