本文整理汇总了PHP中ElggGroup::setPrivateSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggGroup::setPrivateSetting方法的具体用法?PHP ElggGroup::setPrivateSetting怎么用?PHP ElggGroup::setPrivateSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggGroup
的用法示例。
在下文中一共展示了ElggGroup::setPrivateSetting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMerchantAccount
/**
* Retrieve a Stripe account for this mercant
*
* @return Stripe_Customer|boolean
* @throws Stripe_Error
*/
public function getMerchantAccount()
{
if ($this->account->id) {
return $this->account;
}
if (!$this->entity) {
return false;
}
if (!($access_token = $this->getAccessToken())) {
return false;
}
try {
$stripe = new StripeClient();
$stripe->setAccessToken($access_token);
$account = $stripe->getAccount();
if (!$account->id || isset($account->deleted)) {
throw new Stripe_Error('Account does not exist or has been deleted');
}
$this->account = $account;
return $this->account;
} catch (Stripe_Error $e) {
$this->entity->setPrivateSetting('stripe_secret_key', null);
$this->entity->setPrivateSetting('stripe_publishable_key', null);
return false;
}
}
示例2: foreach
foreach ($tool_options as $group_option) {
$option_toggle_name = $group_option->name . "_enable";
$option_default = $group_option->default_on ? 'yes' : 'no';
$group->{$option_toggle_name} = get_input($option_toggle_name, $option_default);
}
}
// Group membership - should these be treated with same constants as access permissions?
$is_public_membership = get_input('membership') == ACCESS_PUBLIC;
$group->membership = $is_public_membership ? ACCESS_PUBLIC : ACCESS_PRIVATE;
$group->setContentAccessMode(get_input('content_access_mode'));
if ($is_new_group) {
$group->access_id = ACCESS_PUBLIC;
}
// default access
$default_access = (int) get_input('group_default_access');
$group->setPrivateSetting("elgg_default_access", $default_access);
if ($is_new_group) {
// if new group, we need to save so group acl gets set in event handler
$group->save();
}
// Invisible group support
// @todo this requires save to be called to create the acl for the group. This
// is an odd requirement and should be removed. Either the acl creation happens
// in the action or the visibility moves to a plugin hook
if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
$visibility = (int) get_input('vis');
if ($visibility == ACCESS_PRIVATE) {
// Make this group visible only to group members. We need to use
// ACCESS_PRIVATE on the form and convert it to group_acl here
// because new groups do not have acl until they have been saved once.
$visibility = $group->group_acl;