add new method SeedDMS_Core_Folder::getDocumentsMinMax()

This commit is contained in:
Uwe Steinmann 2018-02-07 09:51:20 +01:00
parent fdadd6b043
commit e5b215936a
2 changed files with 17 additions and 1 deletions

View File

@ -1692,6 +1692,22 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
return true;
} /* }}} */
/**
* Get the min and max sequence value for documents
*
* @return boolean/array array with keys 'min' and 'max', false in case of an error
*/
function getDocumentsMinMax() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT min(`sequence`) AS `min`, max(`sequence`) AS `max` FROM `tblDocuments` WHERE `folder` = " . (int) $this->_id;
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr == false)
return false;
return $resArr[0];
} /* }}} */
}
?>

View File

@ -24,7 +24,7 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
just version bump up
add SeedDMS_Core_Folder::getDocumentsMinMax()
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">