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

//should be general SMS class
//if you want alert connected logically in monitoring, try to search the content
//with the agent description

Class SMS Extends EntityBase{

	private $id;
	private $posttime;
	private $content;
	//boolean type
	private $send;
	private $destination;

	public function __construct(){
	  	//PHYSIC TABLE DEFINITION for SMS
		//-----------------------------------------------------
		$tablename = 'buffersms';

		$field_id = 'sms_id';
		$field_posttime = 'posttime';
		$field_content = 'content';
		$field_send = 'send';
		$field_destination = 'destination';
		//-----------------------------------------------------

		$rawfields = array('id'=>$field_id,'content'=>$field_content,'posttime'=>$field_posttime,'send'=>$field_send,'destination'=>$field_destination);
		$attributes = array($field_posttime,$field_content,$field_destination,$field_send);

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

	//not implemented
	//SMS should not be edited.. only can be truncated
	public function selectByID($id){
	}

	//empty the table only for send=true 
	public function truncate(){
		$condition = $this->getField('send').'='.'\'true\'';
		$sql = 'DELETE FROM '.$this->getPrimaryTable().' WHERE '.$condition;
		$this->dba->exec($sql);
	}
}
?>
Return current item: Monyet