Пример #1
0
 /**
  * Updates a transaction record
  *
  * @param Model_Core_Transaction $transaction
  * @return bool
  */
 public function updateTransaction(Model_Core_Transaction $transaction)
 {
     // Firstly we need to see if this already exists
     $select = $this->select();
     $select->where('ID = ?', $transaction->getId());
     $row = $this->fetchRow($select);
     // There should only be a single transaction with the given id
     if (count($row) == 1) {
         $data = array('PreviousID' => $transaction->getPreviousId(), 'EnquiryID' => $transaction->getEnquiryId(), 'Amount' => $transaction->getAmount(), 'StatusID' => $transaction->getStatusId(), 'InvoiceID' => $transaction->getInvoiceId(), 'CreditNoteID' => $transaction->getCreditNoteId(), 'InsuranceNetAmount' => $transaction->getInsuranceNetAmount(), 'TransactionDate' => $transaction->getTransactionDate());
         $where = $this->_db->quoteInto('ID = ?', $transaction->getId());
         $this->update($data, $where);
         return true;
     }
     Application_Core_Logger::log("Can't update transaction claim in table {$this->_name}", 'error');
     return false;
 }