<?php
require_once(DIR_FS_ADMIN.DIR_WS_CLASSES.'unit.php');
/**
 * units class 
 *
 */
class units extends databasetable
{
	/**
	 * initiates the units class
	 *
	 */
	function units(){
		$this->set_tablename(TABLE_UNITS);
		$this->set_index('units_id');
	}
	
	/**
	 * return a unit object
	 *
	 * @param integer $id
	 * @return object
	 */
	function get_unit($id){
		$values = $this->get_row_by_index($id);
		$unit_instance = new unit( (object) current($values) );
		return $unit_instance;
	}
}
