diff --git a/lib/web/WebDocument.inc b/lib/web/WebDocument.inc index 1480ce3..4827859 100644 --- a/lib/web/WebDocument.inc +++ b/lib/web/WebDocument.inc @@ -125,5 +125,32 @@ class WebDocument { return false; } + /** + * Static function + * Get a list of web documents + * + * @param String Where clause (not required) + * + * @return Array array of WebDocument objects, false otherwise and set $_SESSION["errorMessage"] + */ + function getList($sWhereClause = null) { + global $default, $lang_err_database; + $aWebDocumentArray; + settype($aWebDocumentArray, "array"); + $sql = new Owl_DB(); + $result = $sql->query("SELECT * FROM " . $default->owl_web_documents_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); + if ($result) { + $iCount = 0; + while ($sql->next_record()) { + $oWebDocument = & WebDocument::get($sql->f("id")); + $aWebDocumentArray[$iCount] = $oWebDocument; + $iCount++; + } + return $aWebDocumentArray; + } + $_SESSION["errorMessage"] = $lang_err_database; + return false; + } + } ?> diff --git a/lib/web/WebSite.inc b/lib/web/WebSite.inc index e848d20..cc2aca8 100644 --- a/lib/web/WebSite.inc +++ b/lib/web/WebSite.inc @@ -7,7 +7,9 @@ * Represents a web site as per the web_sites database table * * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa -* @date 20 January 2003 +* @date 20 January 2003 +* +* @todo - add regex parsing to ensure URL is valid */ class WebSite { @@ -38,6 +40,77 @@ class WebSite { } /** + * Get the primary key for this object + * + * @return int primary key for this object + * + */ + function getID() { + return $this->iId; + } + + /** + * Get the web site name + * + * @return String web site name + * + */ + function getWebSiteName() { + return $this->sWebSiteName; + } + + /** + * Set the web site name + * + * @param String Web site name + * + */ + function setWebSiteName($sNewValue) { + $this->sWebSiteName = $sNewValue; + } + + /** + * Get the web site URL + * + * @return String web site URL + * + */ + function getWebSiteURL() { + return $this->sWebSiteURL; + } + + /** + * Set the web site URL + * + * @param String Web site URL + * + */ + function setWebSiteURL($sNewValue) { + $this->sWebSiteURL = $sNewValue; + } + + /** + * Get the primary key of the user that is the web master + * + * @return int primary key of user that is the web master + * + */ + function getWebMasterID() { + return $this->iWebMasterID; + } + + /** + * Set the web master id + * + * @param int Primary key of user that is web master + * + */ + function setWebMasterID() { + $this->iWebMasterID = $iNewValue; + } + + + /** * Create the current object in the database * * @return boolean on successful store, false otherwise and set $_SESSION["errorMessage"]