本文整理汇总了PHP中ElggUser::removePrivateSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggUser::removePrivateSetting方法的具体用法?PHP ElggUser::removePrivateSetting怎么用?PHP ElggUser::removePrivateSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggUser
的用法示例。
在下文中一共展示了ElggUser::removePrivateSetting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCustomerAccount
/**
* Retrieve a Stripe customer account
* @return Stripe_Customer|boolean
* @throws Stripe_Error
*/
public function getCustomerAccount()
{
if ($this->account->id) {
return $this->account;
}
try {
$customer_id = $this->getCustomerId();
if (!$customer_id) {
throw new Stripe_Error('No customer id');
}
$stripe = new StripeClient();
$account = $stripe->getCustomer($customer_id);
if (!$account->id || isset($account->deleted)) {
throw new Stripe_Error('Customer does not exist or has been deleted');
}
return $account;
} catch (Stripe_Error $e) {
$this->user->removePrivateSetting('stripe_customer_id');
error_log($e->getMessage());
return $this->getCustomerAccount();
}
}