当前位置: 首页>>代码示例>>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;未经允许,请勿转载。