array('model'=>'Service_Plugin_Adsl','foreign_key'=>'service_username','far_key'=>'service'), ); public function rules() { $result = parent::rules(); // We don use the "ID" field. unset($result['id']); return $result; } public function traffic(Model_Product_Plugin_Adsl $plan) { // Roll up the charges according to the product plan configuration return ADSL::allowance(array( 'base_down_peak'=>is_null($plan->base_down_peak) ? NULL : $this->down_peak, 'base_down_offpeak'=>is_null($plan->base_down_offpeak) ? NULL : $this->down_offpeak, 'base_up_peak'=>is_null($plan->base_up_peak) ? NULL : $this->up_peak, 'base_up_offpeak'=>is_null($plan->base_up_offpeak) ? NULL : $this->up_offpeak, 'extra_down_peak'=>$plan->extra_down_peak, 'extra_down_offpeak'=>$plan->extra_down_offpeak, 'extra_up_peak'=>$plan->extra_up_peak, 'extra_up_offpeak'=>$plan->extra_up_offpeak, )); } } ?>