mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
- getDocumentCategoryByName() returns just one category
This commit is contained in:
parent
afb4774ada
commit
63bf8505a8
|
@ -923,6 +923,14 @@ class LetoDMS_Core_DMS {
|
||||||
return $categories;
|
return $categories;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a category by its name
|
||||||
|
*
|
||||||
|
* The name of a category is by default unique.
|
||||||
|
*
|
||||||
|
* @param string $name human readable name of category
|
||||||
|
* @return object instance of LetoDMS_Core_DocumentCategory
|
||||||
|
*/
|
||||||
function getDocumentCategoryByName($name) { /* {{{ */
|
function getDocumentCategoryByName($name) { /* {{{ */
|
||||||
$queryStr = "SELECT * FROM tblCategory where name='".$name."'";
|
$queryStr = "SELECT * FROM tblCategory where name='".$name."'";
|
||||||
|
|
||||||
|
@ -930,14 +938,11 @@ class LetoDMS_Core_DMS {
|
||||||
if (is_bool($resArr) && !$resArr)
|
if (is_bool($resArr) && !$resArr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$categories = array();
|
$row = $resArr[0];
|
||||||
foreach ($resArr as $row) {
|
$cat = new LetoDMS_Core_DocumentCategory($row["id"], $row["name"]);
|
||||||
$cat = new LetoDMS_Core_DocumentCategory($row["id"], $row["name"]);
|
$cat->setDMS($this);
|
||||||
$cat->setDMS($this);
|
|
||||||
array_push($categories, $cat);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $categories;
|
return $cat;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function addDocumentCategory($name) { /* {{{ */
|
function addDocumentCategory($name) { /* {{{ */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user