From 2ecefae34b69088aaee40ad5d3a63c2fc03c2dba Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 7 Jul 2003 15:09:18 +0000 Subject: [PATCH] added getList method --- lib/documentmanagement/DocumentType.inc | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/documentmanagement/DocumentType.inc b/lib/documentmanagement/DocumentType.inc index 220d3dc..6b524aa 100644 --- a/lib/documentmanagement/DocumentType.inc +++ b/lib/documentmanagement/DocumentType.inc @@ -201,9 +201,26 @@ class DocumentType { return false; } - - - + /** + * Static- Get a list document types; + * + * @param String Where clause (not required) + * + * @return Array array of DocumentType objects, false otherwise + */ + function getList($sWhereClause = null) { + global $default, $lang_err_database; + $aDocumentTypeArray = array(); + $sql = $default->db; + $result = $sql->query("SELECT * FROM " . $default->owl_document_types_table . (isset($sWhereClause) ? " WHERE $sWhereClause" : "")); + if ($result) { + while ($sql->next_record()) { + $aDocumentTypeArray[] = & DocumentType::get($sql->f("id")); + } + return $aDocumentTypeArray; + } + return false; + } } -- libgit2 0.21.4