<?php
require_once (PATH_TABLES . "admin/LocalLangTermTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

class LocalLangTermClass extends MasterBase {
	private $fldid1;
	private $fldid2;
	
	function __construct($db) {
		$this->db = $db ;
		$this->tbl = LocalLangTermTable::C_TABLE ;
		$this->fldid1 = LocalLangTermTable::C_APP_ID ;
		$this->fldid2 = LocalLangTermTable::C_TERM_ID ;
		$this->flddesc = LocalLangTermTable::C_DESC ;
	}
	function __destruct() {
	}
	
	function getRecordByTermIdAndAppId($termId,$appId) {
		$sql = "select * from " . $this->tbl
		. " where " . $this->db->fieldParam($this->fldid1) 
		. " and " . $this->db->fieldParam($this->fldid2) ;
		$params = array() ;
		$params[] = $this->db->valueParam($this->fldid1,$appId) ;
		$params[] = $this->db->valueParam($this->fldid2,$termId) ;
		$rows = $this->db->getRow($sql,$params) ;
		if (is_null($rows) || count($rows) == 0)
			return null ;
		else
			return $rows[0] ;
	}
	
}
?>