當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EE_Transaction::set_reg_steps方法代碼示例

本文整理匯總了PHP中EE_Transaction::set_reg_steps方法的典型用法代碼示例。如果您正苦於以下問題:PHP EE_Transaction::set_reg_steps方法的具體用法?PHP EE_Transaction::set_reg_steps怎麽用?PHP EE_Transaction::set_reg_steps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EE_Transaction的用法示例。


在下文中一共展示了EE_Transaction::set_reg_steps方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: remove_reg_step

 /**
  * remove_reg_step
  * given a valid TXN_reg_step slug, this will remove (unset)
  * the reg step from the TXN reg step array
  *
  * @access public
  * @param \EE_Transaction $transaction
  * @param string $reg_step_slug
  * @return void
  */
 public function remove_reg_step(EE_Transaction $transaction, $reg_step_slug)
 {
     // get reg steps array
     $txn_reg_steps = $transaction->reg_steps();
     unset($txn_reg_steps[$reg_step_slug]);
     $transaction->set_reg_steps($txn_reg_steps);
 }
開發者ID:DavidSteinbauer,項目名稱:event-espresso-core,代碼行數:17,代碼來源:EE_Transaction_Processor.class.php

示例2: _set_reg_step_completed_status

 /**
  * set_reg_step_completed
  * given a valid reg step slug, this sets the TXN_reg_step completed status which is either:
  *
  *
  * @access private
  * @param \EE_Transaction $transaction
  * @param string          $reg_step_slug
  * @param boolean | int $status
  * @return boolean
  */
 private function _set_reg_step_completed_status(EE_Transaction $transaction, $reg_step_slug, $status)
 {
     // validate status
     $status = is_bool($status) || is_numeric($status) ? $status : false;
     // get reg steps array
     $txn_reg_steps = $transaction->reg_steps();
     // if reg step does NOT exist
     if (!isset($txn_reg_steps[$reg_step_slug])) {
         return false;
     }
     // if  we're trying to complete a step that is already completed
     if ($txn_reg_steps[$reg_step_slug] === true) {
         return true;
     }
     // if  we're trying to complete a step that hasn't even started
     if ($status === true && $txn_reg_steps[$reg_step_slug] === false) {
         return false;
     }
     // if current status value matches the incoming value (no change)
     if ($txn_reg_steps[$reg_step_slug] === $status) {
         // this will happen in cases where multiple AJAX requests occur during the same step
         return true;
     }
     // if we're trying to set a start time
     if (is_numeric($status) && is_numeric($txn_reg_steps[$reg_step_slug])) {
         // skip the update below, but don't return FALSE so that errors won't be displayed
         return true;
     }
     // update completed status
     $txn_reg_steps[$reg_step_slug] = $status;
     $transaction->set_reg_steps($txn_reg_steps);
     $transaction->save();
     // DEBUG LOG
     //$this->log(
     //	__CLASS__, __FUNCTION__, __LINE__,
     //	$transaction,
     //	array(
     //		'reg_step_slug' => $reg_step_slug,
     //		'status' => $status,
     //	)
     //);
     return true;
 }
開發者ID:kaffiemetsuker,項目名稱:event-espresso-core,代碼行數:54,代碼來源:EE_Transaction_Processor.class.php


注:本文中的EE_Transaction::set_reg_steps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。