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

//network map for network definition (i.e 202.160.0.0/16 etc)

Class NetMapNet Extends EntityBase implements Observer{

	private $id;
	private $x;
	private $y;
	private $name;

	public function __construct(){
		//PHYSIC TABLE DEFINITION for NetMapAgent
		//-----------------------------------------------------
		$tablename = 'mapnetwork_net';
		
		$field_id = 'id';
		$field_x = 'x';
		$field_y = 'y';
		$field_name = 'name';
		//-----------------------------------------------------
		
		$rawfields = array('id'=>$field_id,'x'=>$field_x,'y'=>$field_y,'name'=>$field_name);
		$attributes = array($field_name,$field_x,$field_y);
		$condition = 1;

		parent::__construct($tablename,$field_id,$attributes,$rawfields,$condition);
	}

	//not yet tested
	//should be listen to Agent
	public function notifyRemove($obj,$id){
		if($obj instanceOf Group){
			$this->removeWith($this->getField('group'),$id);
		}
	}
	
	//this is only wrapper to provide single object
	//just copy paste for all children
	public function selectByID($id){
		$tempobj = parent::selectByID($id);
		if($tempobj){
			foreach($this->rawfields as $key => $value){
				$this->$key = $tempobj->$value;
			}
		}
	}

	public function getX(){
		return $this->x;
	}

	public function getY(){
		return $this->y;
	}

	public function getName(){
		return $this->name;
	}
	public function __destruct(){
		parent::__destruct();	
	}
}

?>
Return current item: Monyet