本文整理汇总了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;
}