private function loadCommTypeAttr(Gpf_Rpc_Form $form, $attributeName) { $commTypeAttr = new Pap_Db_CommissionTypeAttribute(); $commTypeAttr->setCommissionTypeId($form->getFieldValue("Id")); $commTypeAttr->setName($attributeName); try { $commTypeAttr->loadFromData(array(Pap_Db_Table_CommissionTypeAttributes::COMMISSION_TYPE_ID, Pap_Db_Table_CommissionTypeAttributes::NAME)); $form->addField($attributeName, $commTypeAttr->getValue()); } catch (Gpf_Exception $e) { $form->addField($attributeName, '0'); } }
/** * Load commissionType from $commissionTypeId and name * * @throws Gpf_DbEngine_NoRowException * @throws Gpf_DbEngine_TooManyRowsException * * @return Pap_Db_CommissionTypeAttribute */ public function getCommissionTypeAttribute($commissionTypeId, $name) { $commTypeAttr = new Pap_Db_CommissionTypeAttribute(); $commTypeAttr->setCommissionTypeId($commissionTypeId); $commTypeAttr->setName($name); $commTypeAttr->loadFromData(array(self::COMMISSION_TYPE_ID, self::NAME)); return $commTypeAttr; }