Location: PHPKode > projects > Monyet > classes/snmpdef.php
<?php

//this class will be notified if corresponding agent is deleted
//if ping is priorited. the priority sets to null
//

Final Class SNMPDef Extends EntityBase {

	private $id;
	private $oid;
	private $version;
	private $isdelta;
	private $name;
	
	public function __construct(){

		//PHYSIC TABLE DEFINITION for SNMP Monitoring
		//-----------------------------------------------------
		$tablename = 'snmpdef';

		$field_id = 'snmp_id';	
		$field_name = "monname";
		$field_oid = 'oid';
		$field_version = 'version';
		$field_isdelta = 'isdelta';
		//-----------------------------------------------------

		$rawfields = array('id'=>$field_id,'oid'=>$field_oid,'version'=>$field_version,"name"=>$field_name,
				  "isdelta"=>$field_isdelta);
	
		$attributes = array($field_name,$field_oid,$field_version,$field_isdelta);
		parent::__construct($tablename,$field_id,$attributes,$rawfields,1);
	}

	//this is only wrapper to provide single object
	//just copy paste for all children
	public function selectByID($id){
		if($id[0]=='p'){
			//special for ping monitoring to simplify query table
			$tempstring = explode('_',$id);
			$id =  $tempstring[1];
		}
		$tempobj = parent::selectByID($id);
		if($tempobj){
			foreach($this->rawfields as $key => $value){
				$this->$key = $tempobj->$value;
			}
		}
	}
	public function getOID(){
		return $this->oid;
	}
	public function getVersion(){
		return $this->oid;
	}
	public function getGreenLine(){
		return $this->green;
	}
	public function getRedLine(){
		return $this->red;
	}
	public function getIsDelta(){
		return $this->isdelta;
	}
	public function getName(){
		return $this->name;
	}
	
	public function __destruct(){
		parent::__destruct();	
	}
}

?>
Return current item: Monyet