Internal overhaul
This commit is contained in:
@@ -14,7 +14,7 @@ class Model_ADSL_Supplier extends ORM_OSB {
|
||||
|
||||
// Relationships
|
||||
protected $_has_many = array(
|
||||
'adsl_supplier_plan'=>array('model'=>'ADSL_Supplier_Plan','foreign_key'=>'supplier_id','far_key'=>'id'),
|
||||
'plan'=>array('model'=>'ADSL_Supplier_Plan','foreign_key'=>'supplier_id','far_key'=>'id'),
|
||||
'traffic'=>array('model'=>'Service_Plugin_Adsl_Traffic','foreign_key'=>'supplier_id','far_key'=>'id'),
|
||||
);
|
||||
|
||||
@@ -50,7 +50,7 @@ class Model_ADSL_Supplier extends ORM_OSB {
|
||||
* Return a list of plans that this supplier makes available
|
||||
*/
|
||||
public function find_plans($active=TRUE) {
|
||||
return $active ? $this->adsl_supplier_plan->where_active() : $this->adsl_supplier_plan;
|
||||
return $active ? $this->plan->where_active() : $this->plan;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,8 +63,8 @@ class Model_ADSL_Supplier extends ORM_OSB {
|
||||
|
||||
foreach ($this->find_plans(FALSE)->find_all() as $aspo) {
|
||||
foreach ($aspo->plan->find_all() as $apo) {
|
||||
foreach ($apo->products(FALSE)->find_all() as $po) {
|
||||
foreach ($po->services($active)->find_all() as $so) {
|
||||
foreach ($apo->products(FALSE) as $po) {
|
||||
foreach ($po->service->list_active() as $so) {
|
||||
array_push($result,$so);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user