Commit 2ecefae34b69088aaee40ad5d3a63c2fc03c2dba
1 parent
9c92f314
added getList method
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2309 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
20 additions
and
3 deletions
lib/documentmanagement/DocumentType.inc
| ... | ... | @@ -201,9 +201,26 @@ class DocumentType { |
| 201 | 201 | return false; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - | |
| 205 | - | |
| 206 | - | |
| 204 | + /** | |
| 205 | + * Static- Get a list document types; | |
| 206 | + * | |
| 207 | + * @param String Where clause (not required) | |
| 208 | + * | |
| 209 | + * @return Array array of DocumentType objects, false otherwise | |
| 210 | + */ | |
| 211 | + function getList($sWhereClause = null) { | |
| 212 | + global $default, $lang_err_database; | |
| 213 | + $aDocumentTypeArray = array(); | |
| 214 | + $sql = $default->db; | |
| 215 | + $result = $sql->query("SELECT * FROM " . $default->owl_document_types_table . (isset($sWhereClause) ? " WHERE $sWhereClause" : "")); | |
| 216 | + if ($result) { | |
| 217 | + while ($sql->next_record()) { | |
| 218 | + $aDocumentTypeArray[] = & DocumentType::get($sql->f("id")); | |
| 219 | + } | |
| 220 | + return $aDocumentTypeArray; | |
| 221 | + } | |
| 222 | + return false; | |
| 223 | + } | |
| 207 | 224 | } |
| 208 | 225 | |
| 209 | 226 | ... | ... |