Fixed ADSL traffic collection, and migrated Task to Minion
This commit is contained in:
28
modules/adsl/classes/Task/Adsl/Trafficget.php
Normal file
28
modules/adsl/classes/Task/Adsl/Trafficget.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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 {
|
||||
private function _traffic_suppliers($active=FALSE) {
|
||||
$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'))
|
||||
echo $aso->name."\n";
|
||||
|
||||
Service_Traffic_Adsl::instance($aso->name)->update_traffic();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user