This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/task/classes/Model/Task.php

33 lines
785 B
PHP
Raw Normal View History

2011-08-16 02:27:19 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports Tasks
*
2013-03-19 22:35:19 +00:00
* @package Task
2011-08-16 02:27:19 +00:00
* @category Models
* @author Deon George
2013-03-19 22:35:19 +00:00
* @copyright (c) 2009-2013 Open Source Billing
2011-08-16 02:27:19 +00:00
* @license http://dev.osbill.net/license.html
*/
class Model_Task extends ORM_OSB {
2011-08-16 02:27:19 +00:00
protected $_display_filters = array(
'date_run'=>array(
array('Config::datetime',array(':value')),
),
);
2013-05-02 09:52:19 +00:00
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);
2011-08-16 02:27:19 +00:00
}
2013-05-02 09:52:19 +00:00
/**
* Calculate next run date
*/
public function next_run($format=FALSE) {
$x = $this->_cron()->next($this->date_run);
2011-08-16 02:27:19 +00:00
2013-05-02 09:52:19 +00:00
return $format ? Config::datetime($x) : $x;
2011-08-16 02:27:19 +00:00
}
}
?>