public static function parseSaveData($postArr) { $hspPaymentRequest = new HspPaymentRequest(); if (!empty($postArr['txtId'])) { $hspPaymentRequest->setId($postArr['txtId']); } if (!empty($postArr['txtEmployeeId'])) { $hspPaymentRequest->setEmployeeId($postArr['txtEmployeeId']); } if (!empty($postArr['cmbPlanName'])) { $hspPlanName = $postArr['cmbPlanName']; } else { if (!empty($postArr['hidPlanName'])) { $hspPlanName = $postArr['hidPlanName']; } } $hspPaymentRequest->setHspId(DefineHsp::getHspPlanId($hspPlanName)); if (!empty($postArr['txtDateIncurred'])) { $hspPaymentRequest->setDateIncurred($postArr['txtDateIncurred']); } if (!empty($postArr['txtProviderName'])) { $hspPaymentRequest->setProviderName($postArr['txtProviderName']); } if (!empty($postArr['txtPersonIncurringExpense'])) { $hspPaymentRequest->setPersonIncurringExpense($postArr['txtPersonIncurringExpense']); } if (!empty($postArr['txtExpenseDescription'])) { $hspPaymentRequest->setExpenseDescription($postArr['txtExpenseDescription']); } if (!empty($postArr['txtExpenseAmount'])) { $hspPaymentRequest->setExpenseAmount($postArr['txtExpenseAmount']); } if (!empty($postArr['txtPaymentMadeTo'])) { $hspPaymentRequest->setPaymentMadeTo($postArr['txtPaymentMadeTo']); } if (!empty($postArr['txtThirdPartyAccountNumber'])) { $hspPaymentRequest->setThirdPartyAccountNumber($postArr['txtThirdPartyAccountNumber']); } if (!empty($postArr['txtMailAddress'])) { $hspPaymentRequest->setMailAddress($postArr['txtMailAddress']); } if (!empty($postArr['txtComments'])) { $hspPaymentRequest->setComments($postArr['txtComments']); } if (!empty($postArr['txtDatePaid'])) { $hspPaymentRequest->setDatePaid($postArr['txtDatePaid']); } if (!empty($postArr['txtCheckNumber'])) { $hspPaymentRequest->setCheckNumber($postArr['txtCheckNumber']); } if (!empty($postArr['checkPaperworkSubmitted'])) { $hspPaymentRequest->setPaperWorkSubmitted($postArr['checkPaperworkSubmitted']); } if (!empty($postArr['txtHrNotes'])) { $hspPaymentRequest->setHrNotes($postArr['txtHrNotes']); } return $hspPaymentRequest; }
public function testAddHspRequest() { $paymentRequest = new HspPaymentRequest(); // Adding correct Data $paymentRequest->setHspId(0); $paymentRequest->setEmployeeId(11); $paymentRequest->setDateIncurred(date('Y-m-d', time() - 3600 * 24)); $paymentRequest->setProviderName('Jack'); $paymentRequest->setPersonIncurringExpense('Bauer'); $paymentRequest->setExpenseDescription('Health'); $paymentRequest->setExpenseAmount(100); $paymentRequest->setPaymentMadeTo('Neena'); $paymentRequest->setThirdPartyAccountNumber('123456'); $paymentRequest->setMailAddress(''); $paymentRequest->setComments(''); //$paymentRequest->setDatePaid($expected[13]); //$paymentRequest->setCheckNumber($expected[14]); $paymentRequest->setStatus(1); $this->assertTrue($paymentRequest->addHspRequest()); }
private static function _buildObjArr($result) { $objArr = array(); while ($row = mysql_fetch_assoc($result)) { $tmpArr = new HspPaymentRequest(); $tmpArr->setId($row[self::DB_FIELD_ID]); $tmpArr->setHspId($row[self::DB_FIELD_HSP_ID]); $tmpArr->setEmployeeId($row[self::DB_FIELD_EMPLOYEE_ID]); $tmpArr->setDateIncurred($row[self::DB_FIELD_DATE_INCURRED]); $tmpArr->setProviderName($row[self::DB_FIELD_PROVIDER_NAME]); $tmpArr->setPersonIncurringExpense($row[self::DB_FIELD_PERSON_INCURRING_EXPENSE]); $tmpArr->setExpenseDescription($row[self::DB_FIELD_EXPENSE_DESCRIPTION]); $tmpArr->setExpenseAmount($row[self::DB_FIELD_EXPENSE_AMOUNT]); $tmpArr->setPaymentMadeTo($row[self::DB_FIELD_PAYMENT_MADE_TO]); $tmpArr->setThirdPartyAccountNumber($row[self::DB_FIELD_THIRD_PARTY_ACCOUNT_NUMBER]); $tmpArr->setMailAddress($row[self::DB_FIELD_MAIL_ADDRESS]); $tmpArr->setComments($row[self::DB_FIELD_COMMENTS]); $tmpArr->setDatePaid($row[self::DB_FIELD_DATE_PAID]); $tmpArr->setCheckNumber($row[self::DB_FIELD_CHECK_NUMBER]); $tmpArr->setStatus($row[self::DB_FIELD_STATUS]); $tmpArr->setHrNotes($row[self::DB_FIELD_HR_NOTES]); $objArr[] = $tmpArr; } return $objArr; }