protected function _changeParent(Model $model, $id = null, $parentId = null) {
		$parentField = $this->_getBehaviorConfig($model, 'parent');
		if (empty($id) || ($parentField === null)) {
			return false;
		}

		$model->recursive = -1;
		$treeItem = $model->read(null, $id);
		if (empty($treeItem)) {
			return false;
		}

		$treeItem[$model->alias][$parentField] = $parentId;
		$result = (bool)$model->save($treeItem);

		return $result;
	}
protected function _changeParent(Model $model, $id = null, $parentId = null) {
		$parentField = $this->_getBehaviorConfig($model, 'parent');
		if (empty($id) || ($parentField === null)) {
			return false;
		}

		$model->recursive = -1;
		$treeItem = $model->read(null, $id);
		if (empty($treeItem)) {
			return false;
		}

		$treeItem[$model->alias][$parentField] = $parentId;
		$result = (bool)$model->save($treeItem);

		return $result;
	}
protected function _changeParent ( Model $ model , $ id = null , $ parentId = null ) { $ parentField = $ this -> _getBehaviorConfig ( $ model , 'parent' ) ; if ( empty ( $ id ) || ( $ parentField === null ) ) { return false ; } $ model -> recursive = - 1 ; $ treeItem = $ model -> read ( null , $ id ) ; if ( empty ( $ treeItem ) ) { return false ; } $ treeItem [ $ model -> alias ] [ $ parentField ] = $ parentId ; $ result = ( bool ) $ model -> save ( $ treeItem ) ; return $ result ; }
Change parent ID of item.

@param Model $model Model using this behavior.
@param int|string $id The ID of item for change parent.
@param int|string|null $parentId New parent ID of item.
@return bool
Change parent ID of item .