private function insertReferralCommissionType() { $commissionType = new Pap_Db_CommissionType(); $commissionType->setType(Pap_Common_Constants::TYPE_REFERRAL); $commissionType->setStatus(Pap_Db_CommissionType::STATUS_ENABLED); $commissionType->setApproval(Pap_Db_CommissionType::APPROVAL_AUTOMATIC); $commissionType->setZeroOrdersCommission(Gpf::NO); $commissionType->setSaveZeroCommission(Gpf::NO); try { $commissionType->insert(); } catch (Gpf_DbEngine_Row_ConstraintException $e) { } }
private function addCpmCommissionToCampaigns() { $campaign = new Pap_Db_Campaign(); $campaigns = $campaign->loadCollection(); foreach ($campaigns as $campaign) { $commissionType = new Pap_Db_CommissionType(); $commissionType->setCampaignId($campaign->getId()); $commissionType->setType(Pap_Common_Constants::TYPE_CPM); try { $commissionType->loadFromData(); } catch (Gpf_DbEngine_NoRowException $e) { $commissionType->setStatus(Pap_Db_CommissionType::STATUS_DISABLED); $commissionType->setRecurrencePresetId(Pap_Db_CommissionType::RECURRENCE_NONE); $commissionType->setApproval(Pap_Db_CommissionType::APPROVAL_AUTOMATIC); $commissionType->setZeroOrdersCommission(Gpf::NO); $commissionType->setSaveZeroCommission(Gpf::NO); $commissionType->insert(); } } }
public function insertCommissionType($type) { $commissionType = new Pap_Db_CommissionType(); $commissionType->setCampaignId($this->getId()); $commissionType->setType($type); $commissionType->setStatus(Pap_Db_CommissionType::STATUS_ENABLED); $commissionType->setApproval(Pap_Db_CommissionType::APPROVAL_AUTOMATIC); $commissionType->setRecurrencePresetId(Pap_Db_CommissionType::RECURRENCE_NONE); $commissionType->setZeroOrdersCommission(Gpf::NO); $commissionType->setSaveZeroCommission(Gpf::NO); $commissionType->insert(); return $commissionType->getId(); }
private function createReferralCommissionType() { $commissionType = new Pap_Db_CommissionType(); $commissionType->setType(Pap_Common_Constants::TYPE_REFERRAL); $commissionType->setStatus(Pap_Db_CommissionType::STATUS_ENABLED); $commissionType->setApproval(Pap_Db_CommissionType::APPROVAL_AUTOMATIC); $commissionType->setZeroOrdersCommission(Gpf::NO); $commissionType->setSaveZeroCommission(Gpf::NO); $commissionType->insert(); }