Consistent use of return , payment refund handling
This commit is contained in:
@@ -17,7 +17,7 @@ class Service_Traffic_ADSL_iiNetADSL extends Service_Traffic_ADSL {
|
||||
private $login_pass_field = 'password';
|
||||
private $date_field = 'period';
|
||||
|
||||
static $return = array();
|
||||
static $result = array();
|
||||
|
||||
// The fields in the XML which are translated into database columns
|
||||
private $fields = array(
|
||||
@@ -37,8 +37,8 @@ class Service_Traffic_ADSL_iiNetADSL extends Service_Traffic_ADSL {
|
||||
$this->fetchresult = FALSE;
|
||||
|
||||
// If we have already collected the date data, return it.
|
||||
if (! empty(Service_Traffic_ADSL_iiNetADSL::$return[$date]))
|
||||
return Service_Traffic_ADSL_iiNetADSL::$return[$date];
|
||||
if (! empty(Service_Traffic_ADSL_iiNetADSL::$result[$date]))
|
||||
return Service_Traffic_ADSL_iiNetADSL::$result[$date];
|
||||
|
||||
// Find our services that need to be collected this way.
|
||||
$update = array();
|
||||
@@ -77,7 +77,7 @@ class Service_Traffic_ADSL_iiNetADSL extends Service_Traffic_ADSL {
|
||||
file_put_contents($debug_file,$data);
|
||||
}
|
||||
|
||||
$return = array();
|
||||
$result = array();
|
||||
foreach (XML::factory(NULL,'ii_feed',$data)->volume_usage->volume_usage->get('day_hour') as $day_hour) {
|
||||
$attrs = array();
|
||||
|
||||
@@ -100,9 +100,9 @@ class Service_Traffic_ADSL_iiNetADSL extends Service_Traffic_ADSL {
|
||||
$attrs[$this->fields[$fields['type']]] += $usage->value()/1000/1000;
|
||||
}
|
||||
|
||||
Service_Traffic_ADSL_iiNetADSL::$return[$period['period']][$so->service_adsl->service_username] = $attrs;
|
||||
Service_Traffic_ADSL_iiNetADSL::$return[$period['period']][$so->service_adsl->service_username]['date'] = $period['period'];
|
||||
Service_Traffic_ADSL_iiNetADSL::$return[$period['period']][$so->service_adsl->service_username]['service'] = $so->service_adsl->service_username;
|
||||
Service_Traffic_ADSL_iiNetADSL::$result[$period['period']][$so->service_adsl->service_username] = $attrs;
|
||||
Service_Traffic_ADSL_iiNetADSL::$result[$period['period']][$so->service_adsl->service_username]['date'] = $period['period'];
|
||||
Service_Traffic_ADSL_iiNetADSL::$result[$period['period']][$so->service_adsl->service_username]['service'] = $so->service_adsl->service_username;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,11 +113,11 @@ class Service_Traffic_ADSL_iiNetADSL extends Service_Traffic_ADSL {
|
||||
}
|
||||
|
||||
// If the date we want is empty, return an array
|
||||
if (empty(Service_Traffic_ADSL_iiNetADSL::$return[$date]))
|
||||
if (empty(Service_Traffic_ADSL_iiNetADSL::$result[$date]))
|
||||
return array();
|
||||
|
||||
// Return the date we asked for
|
||||
return Service_Traffic_ADSL_iiNetADSL::$return[$date];
|
||||
return Service_Traffic_ADSL_iiNetADSL::$result[$date];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user