/** * deletes all the related path. */ function deleteCapabilityPath($path) { $dao =& CopixDAOFactory::create('copix:CopixCapabilityPath'); $daoGroupCapabilities =& CopixDAOFactory::create('copix:CopixGroupCapabilities'); //gets the moved list. $listToDelete = CopixProfileTools::getList($path); //moves the element childs. foreach ((array) $listToDelete as $pathToDelete) { $daoGroupCapabilities->removePath($pathToDelete); $dao->delete($pathToDelete); } //moves the element itself $daoGroupCapabilities->removePath($path); $dao->delete($path); }