当前位置: 首页>>代码示例>>PHP>>正文


PHP EEM_Registration::get_one_by_ID方法代码示例

本文整理汇总了PHP中EEM_Registration::get_one_by_ID方法的典型用法代码示例。如果您正苦于以下问题:PHP EEM_Registration::get_one_by_ID方法的具体用法?PHP EEM_Registration::get_one_by_ID怎么用?PHP EEM_Registration::get_one_by_ID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EEM_Registration的用法示例。


在下文中一共展示了EEM_Registration::get_one_by_ID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _get_return_url

 /**
  *  Gets the URL that the user should generally be sent back to after payment completion offiste
  *  Adds the reg_url_link in order to remember which session we were in the middle of processing
  * @param EE_Registration or int, current registration we want to link back to in the return url.
  * @param boolean $urlencode whether or not to url-encode the url (if true, you probably intend to pass
  * this string as a URL parameter itself, or maybe a post parameter)
  *  @return string URL on the current site of the thank_you page, with parameters added on to know which registration was just
  * processed in order to correctly display the payment status. And it gets URL-encoded by default
  */
 protected function _get_return_url($registration, $urlencode = false)
 {
     //if $registration is an ID instead of an EE_Registration, make it an EE_Registration
     if (!$registration instanceof EE_Registration) {
         $registration = $this->_REG->get_one_by_ID($registration);
     }
     if (empty($registration)) {
         $msg[0] = __("Cannot get Return URL for gateway. Invalid registration", 'event_espresso');
         $msg[1] = sprinf(__("Registration being used is %s.", 'event_espresso'), print_r($registration, true));
         EE_Error::add_error(implode("||", $msg), __FILE__, __FUNCTION__, __LINE__);
         return '';
     }
     //get a registration that's currently getting processed
     /*@var $registration EE_Registration */
     $url = add_query_arg(array('e_reg_url_link' => $registration->reg_url_link()), get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id));
     if ($urlencode) {
         $url = urlencode($url);
     }
     return $url;
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:29,代码来源:EE_Gateway.class.php


注:本文中的EEM_Registration::get_one_by_ID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。