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/adsl/classes/Task/Adsl/Trafficget.php

33 lines
818 B
PHP
Raw Normal View History

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Get ADSL Traffic from Suppliers
*
* @package ADSL
* @category Tasks
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_Adsl_Trafficget extends Minion_Task {
2013-10-11 00:00:16 +00:00
protected $_options = array(
'verbose'=>FALSE,
);
2018-06-13 11:34:58 +00:00
protected function _traffic_suppliers($active=TRUE) {
$suppliers = ORM::factory('ADSL_Supplier');
return $active ? $suppliers->list_active() : $suppliers->find_all();
}
protected function _execute(array $params) {
foreach ($this->_traffic_suppliers(TRUE) as $aso) {
if (Minion_CLI::options('verbose'))
printf("%s: %s\n",$aso->id,$aso->name);
Service_Traffic_Adsl::instance($aso->name)->update_traffic();
}
}
}
?>