, Jam Warehouse (Pty) Ltd, South Africa * @package lib.archiving */ class ArchivingType extends KTEntity { /** * The primary key */ var $iId; /** * The archiving type */ var $sName; /** * Constructs an archiving type instance * * @param string the archiving type name */ function ArchivingType($sNewName) { global $default; // primary key not set as this is not stored yet $this->iId = -1; $this->sName = $sNewName; } /** * Gets the primary key */ function getID(){ return $this->iId; } /** * Gets the name */ function getName() { return $this->sName; } /** * Sets the name * * @param string the new name */ function setName($sNewName){ $this->sName = $sNewName; } function _fieldValues () { return array( 'name' => $this->sName, ); } function _table () { global $default; return $default->archiving_type_lookup_table; } /** * Static function. Given a news item primary key will create * a ArchivingType object and populate it with the corresponding * database values * * @return ArchivingType populated ArchivingType object on success, false otherwise */ function & get($iArchivingTypeID) { global $default; $sql = $default->db; $sql->query(array("SELECT * FROM $default->archiving_type_lookup_table WHERE id = ?", $iArchivingTypeID));/*ok*/ if ($sql->next_record()) { $oArchivingType = & new ArchivingType($sql->f("name")); $oArchivingType->iId = $iArchivingTypeID; return $oArchivingType; } return false; } /** * Static function * Get a list of ArchivingType objects * * @param String Where clause (optional) * @return Array array of ArchivingType objects, false otherwise */ function getList($sWhereClause = null) { return KTEntityUtil::getList(ArchivingType::_table(), 'ArchivingType', $sWhereClause); } }