/** * Remove the current node from the tree, and reparent all children up one level. * * If the parameter delete is false, the node will become a new top level node. Otherwise the node will be deleted * after the children are reparented. * * If the model is scoped and the id parameter is given it will automatically set the scope. For no id parameter * you will have to pass the scope. * * Example: array('scope' => 5) or array('id' => false, 'scope' => 5) * * @param AppModel $Model Model instance * @param mixed $id The ID of the record to remove * @param boolean $delete whether to delete the node after reparenting children (if any) * @return boolean true on success, false on failure * @access public * @link http://book.cakephp.org/view/1354/removeFromTree */ public function removefromtree($Model, $id = null, $delete = false, $scopeField = null) { if ($this->scoped($Model)) { $id = $this->__setScopeFromId($Model, $id); if (empty($id)) { return false; } } return parent::removefromtree($Model, $id, $delete); }