本文整理汇总了PHP中Payment::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::persist方法的具体用法?PHP Payment::persist怎么用?PHP Payment::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::persist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: processDeleteUnallocatedFundsAction
public function processDeleteUnallocatedFundsAction()
{
$paymentId = (int) $this->_getParam('paymentId');
$payment = new Payment();
$payment->paymentId = $paymentId;
$payment->populate();
// double check if paymentId is really an unallocated fund
$result = false;
if ($payment->allocated == 0 && $payment->visitId == 0 && $payment->appointmentId == 0) {
$payment->setPersistMode(WebVista_Model_ORM::DELETE);
$payment->persist();
$funds = Payment::listUnallocatedFunds($payment->personId);
$unallocatedFunds = (double) $funds['total'];
if ($unallocatedFunds < 0) {
$unallocatedFunds = 0;
}
$result = sprintf('%.2f', $unallocatedFunds);
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct($result);
}