本文整理汇总了PHP中Payment::populateWithArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::populateWithArray方法的具体用法?PHP Payment::populateWithArray怎么用?PHP Payment::populateWithArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::populateWithArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAddPaymentAction
public function processAddPaymentAction()
{
$params = $this->_getParam('payment');
$payment = new Payment();
$payment->populateWithArray($params);
if (!$payment->visitId > 0) {
$payment->visitId = $this->_createVisit($payment->appointmentId);
}
$payment->timestamp = date('Y-m-d H:i:s');
$payment->userId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
$payment->persist();
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct(true);
}
示例2: processPaymentAction
public function processPaymentAction()
{
$params = $this->_getParam('payment');
$data = false;
if (is_array($params)) {
$payment = new Payment();
$payment->populateWithArray($params);
if (!strlen($payment->userId) > 0) {
$payment->userId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
}
if (!strlen($payment->timestamp) > 0) {
$payment->timestamp = date('Y-m-d H:i:s');
}
$payment->persist();
$data = true;
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct($data);
}
示例3: listUnallocatedFunds
public static function listUnallocatedFunds($personId)
{
// payments with appointmentId OR payments assigned ONLY to person
$db = Zend_Registry::get('dbAdapter');
$sqlSelect = $db->select()->from('payment')->where('personId = ?', (int) $personId)->where('(amount - allocated) > 0')->where('encounter_id = 0')->where('appointmentId = 0');
$total = 0;
$details = array();
if ($rows = $db->fetchAll($sqlSelect)) {
foreach ($rows as $row) {
$payment = new Payment();
$payment->populateWithArray($row);
$total += $payment->unallocated;
$details[$row['payment_id']] = $payment;
}
}
return array('total' => $total, 'details' => $details);
}
示例4: getCopay
public function getCopay()
{
// payments with appointmentId
$db = Zend_Registry::get('dbAdapter');
$sqlSelect = $db->select()->from('payment')->where('personId = ?', (int) $this->patientId)->where('encounter_id = ?', (int) $this->encounter_id)->where('(amount - allocated) > 0')->where('appointmentId != 0');
$total = 0;
$details = array();
$stmt = $db->query($sqlSelect);
$stmt->setFetchMode(Zend_Db::FETCH_ASSOC);
while ($row = $stmt->fetch()) {
$payment = new Payment();
$payment->populateWithArray($row);
$total += $payment->unallocated;
$details[$row['payment_id']] = $payment;
}
return array('total' => $total, 'details' => $details);
}
示例5: processSaveCheckAction
public function processSaveCheckAction()
{
$params = $this->_getParam('payment');
$data = false;
if (is_array($params)) {
$payment = new Payment();
$payment->populateWithArray($params);
$payment->paymentType = 'CHECK';
$date = date('Y-m-d H:i:s');
$payment->paymentDate = $date;
$payment->timestamp = $date;
$payment->persist();
$data = true;
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct($data);
}