Пример #1
0
 public function setUsageRegularDonation(Donator_Model_RegularDonation $obj)
 {
     $this->__set('context_id', 'DONATOR');
     $this->__set('regular_donation_id', $obj->getId());
     $this->__set('usage_type', 'APPRECORDONLY');
 }
Пример #2
0
 public function addUsageRegularDonation(Donator_Model_RegularDonation $obj)
 {
     try {
         $usage = Billing_Controller_BankAccountUsage::getInstance()->getByContextAndPurpose('DONATOR', 'APPRECORDONLY', $this->getId(), $obj->getId());
         $usage->__set('bank_account_id', $this->getId());
         $usage->setUsageRegularDonation($obj);
     } catch (Exception $e) {
         $usage = Billing_Controller_BankAccountUsage::getInstance()->getEmptyBankAccountUsage(null, true);
         $usage->__set('bank_account_id', $this->getId());
         $usage->setUsageRegularDonation($obj);
         $usage = Billing_Controller_BankAccountUsage::getInstance()->create($usage);
     }
     return $usage;
 }