<?php
require_once(DIR_FS_ADMIN.DIR_WS_CLASSES.'awb_number.php');
/**
 * awb_numbers class 
 *
 */
class awb_numbers extends databasetable
{
	/**
	 * initiates the awb_numbers class
	 *
	 */
	function awb_numbers(){
		$this->set_tablename(TABLE_AWB_NUMBERS);
		$this->set_index('awb_numbers_id');
		/*
		$this->related_tables = array(
			0=>array('table'=>TABLE_CUSTOMERS_TO_COMPANIES,'key'=>$this->get_index() )
		);
		*/
	}
	
	/**
	 * return a awb_number object
	 *
	 * @param integer $id
	 * @return object
	 */
	function get_awb_number($id){
		$values = $this->get_row_by_index($id);
		$awb_number_instance = new awb_number( (object) current($values) );
		return $awb_number_instance;
	}

	function update($id, $booking_hint){
		$this->query(
			sprintf("UPDATE %s SET booking_hint='%s' WHERE %s=%s",$this->get_tablename(),$booking_hint,$this->get_index(),$id)
		);
	}
}
