2011-06-27 07:24:39 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @package PTA
|
|
|
|
* @subpackage Activity Log
|
|
|
|
* @category Models
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 phpTSMadmin Development Team
|
|
|
|
* @license http://phptsmadmin.sf.net/license.html
|
|
|
|
*/
|
2012-12-06 03:50:06 +00:00
|
|
|
class Model_ACTLOG extends ORM_TSM {
|
2011-06-27 07:24:39 +00:00
|
|
|
protected $_table_name = 'ACTLOG';
|
|
|
|
protected $_primary_key = 'DATE_TIME'; // We need a primary key to detect that the object is loaded.
|
|
|
|
protected $_sorting = array(
|
|
|
|
'DATE_TIME'=>'ASC',
|
|
|
|
);
|
2012-12-07 05:12:58 +00:00
|
|
|
|
|
|
|
protected $_display_filters = array(
|
|
|
|
'DATE_TIME'=>array(
|
|
|
|
array('ORM_TSM::date',array(':value','d-M H:i')),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
private $_msgno_ba_objects = array(4952,4953,4954,4958,4960,4957,4970,4959,4982);
|
|
|
|
private $_msgno_ba_bytes = array(4977,4975,4984,4198,4961);
|
|
|
|
private $_msgno_ba_transfer = array(4963,4966,4967,4964);
|
|
|
|
private $_msgno_ba_reduction = array(4968,4981,4976);
|
|
|
|
|
2012-12-12 04:00:03 +00:00
|
|
|
/**
|
|
|
|
* Return the timestamp of the record in the ACTLOG
|
|
|
|
*/
|
|
|
|
public function FirstRec() {
|
|
|
|
return DB::query(Database::SELECT,'SELECT min(DATE_TIME) as DATE_TIME from ACTLOG')->cached(86400)->execute()->get('DATE_TIME');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Where class to exclude NODE backup messages
|
|
|
|
*/
|
|
|
|
public function ExcludeBA() {
|
2012-12-07 05:12:58 +00:00
|
|
|
return $this->where('MSGNO','NOT IN',array_merge($this->_msgno_ba_objects,$this->_msgno_ba_bytes,$this->_msgno_ba_transfer,$this->_msgno_ba_reduction));
|
|
|
|
}
|
2012-12-12 04:00:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return this ACTIVITY LOG start time in seconds since epoch
|
|
|
|
*/
|
|
|
|
public function start() {
|
|
|
|
return ORM_TSM::date($this->DATE_TIME,'U');
|
|
|
|
}
|
2011-06-27 07:24:39 +00:00
|
|
|
}
|
|
|
|
?>
|