Internal overhaul
This commit is contained in:
@@ -19,9 +19,6 @@ class Model_Product_Plugin_Adsl extends Model_Product_Plugin {
|
||||
protected $_belongs_to = array(
|
||||
'supplier_plan'=>array('model'=>'ADSL_Supplier_Plan','foreign_key'=>'adsl_supplier_plan_id'),
|
||||
);
|
||||
protected $_has_many = array(
|
||||
'product'=>array('far_key'=>'id','foreign_key'=>'prod_plugin_data'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters used to format the display of values into friendlier values
|
||||
@@ -59,14 +56,6 @@ class Model_Product_Plugin_Adsl extends Model_Product_Plugin {
|
||||
'extra_up_offpeak',
|
||||
);
|
||||
|
||||
// Map the table fields
|
||||
private $_map = array(
|
||||
'base_up_offpeak'=>'extra_up_offpeak',
|
||||
'base_down_offpeak'=>'extra_down_offpeak',
|
||||
'base_up_peak'=>'extra_up_peak',
|
||||
'base_down_peak'=>'extra_down_peak',
|
||||
);
|
||||
|
||||
// Our required abstract methods
|
||||
|
||||
public function cost($annual=FALSE) {
|
||||
@@ -75,25 +64,24 @@ class Model_Product_Plugin_Adsl extends Model_Product_Plugin {
|
||||
return $annual ? $x*12 : $x;
|
||||
}
|
||||
|
||||
public function feature_summary() {
|
||||
return View::factory(sprintf('product/plugin/%s/feature_summary',$this->plugin()))
|
||||
->set('o',$this);
|
||||
}
|
||||
|
||||
// @todo Select the ADSL Plan for this product.
|
||||
public function render_edit() {
|
||||
return '';
|
||||
}
|
||||
|
||||
public function render_order() {
|
||||
return View::factory(sprintf('product/plugin/%s/order',$this->plugin()));
|
||||
}
|
||||
|
||||
public function supplier() {
|
||||
return $this->supplier_plan->supplier_id;
|
||||
}
|
||||
|
||||
/** LOCAL FUNCTIONS **/
|
||||
// Local functions
|
||||
|
||||
// Map the table fields
|
||||
private $_map = array(
|
||||
'base_up_offpeak'=>'extra_up_offpeak',
|
||||
'base_down_offpeak'=>'extra_down_offpeak',
|
||||
'base_up_peak'=>'extra_up_peak',
|
||||
'base_down_peak'=>'extra_down_peak',
|
||||
);
|
||||
|
||||
/**
|
||||
* Calculate the allowance array or traffic used array
|
||||
@@ -204,19 +192,5 @@ class Model_Product_Plugin_Adsl extends Model_Product_Plugin {
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the products using this plan
|
||||
*/
|
||||
public function products($active=FALSE) {
|
||||
$x = ORM::factory('Product')
|
||||
->where('prod_plugin_file','=','ADSL')
|
||||
->and_where('prod_plugin_data','=',$this);
|
||||
|
||||
if ($active)
|
||||
$x->where_active();
|
||||
|
||||
return $x;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user