add method getFoldersMinMax()

This commit is contained in:
Uwe Steinmann 2021-09-22 09:48:12 +02:00
parent 5a587e5c85
commit da8765fe33

View File

@ -466,7 +466,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
$res = $db->getResult($queryStr);
}
/* Update path in folderList for all documents */
/* Update path in folderList for all folders */
$queryStr = "SELECT `tblFolders`.`id`, `tblFolders`.`folderList` FROM `tblFolders` WHERE `folderList` LIKE '%:".$this->_id.":%'";
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr == false)
@ -2032,6 +2032,22 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
return $resArr[0];
} /* }}} */
/**
* Get the min and max sequence value for folders
*
* @return bool|array array with keys 'min' and 'max', false in case of an error
*/
function getFoldersMinMax() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT min(`sequence`) AS `min`, max(`sequence`) AS `max` FROM `tblFolders` WHERE `parent` = " . (int) $this->_id;
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr == false)
return false;
return $resArr[0];
} /* }}} */
}
?>