33 lines
777 B
PHP
33 lines
777 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class supports Tasks
|
|
*
|
|
* @package Task
|
|
* @category Models
|
|
* @author Deon George
|
|
* @copyright (c) 2009-2013 Open Source Billing
|
|
* @license http://dev.osbill.net/license.html
|
|
*/
|
|
class Model_Task extends ORM {
|
|
protected $_display_filters = array(
|
|
'date_run'=>array(
|
|
array('Site::Datetime',array(':value')),
|
|
),
|
|
);
|
|
|
|
private function _cron() {
|
|
return new Cron(sprintf('%s %s %s %s %s',$this->int_min,$this->int_hour,$this->int_month_day,$this->int_month,$this->int_week_day),$this->command);
|
|
}
|
|
|
|
/**
|
|
* Calculate next run date
|
|
*/
|
|
public function next_run($format=FALSE) {
|
|
$x = $this->_cron()->next($this->date_run);
|
|
|
|
return $format ? Site::Datetime($x) : $x;
|
|
}
|
|
}
|
|
?>
|