Elgg\Database\Plugins::namespacePrivateSetting PHP Method

namespacePrivateSetting() public method

For user_settings, two namespaces are added: a user setting namespace and the plugin id. For internal (plugin priority), there is a single internal namespace added.
public namespacePrivateSetting ( string $type, string $name, string $id = null ) : string
$type string The type of setting: user_setting or internal.
$name string The name to namespace.
$id string The plugin's ID to namespace with. Required for user_setting.
return string
    function namespacePrivateSetting($type, $name, $id = null)
    {
        switch ($type) {
            // commented out because it breaks $plugin->$name access to variables
            //case 'setting':
            //	$name = ELGG_PLUGIN_SETTING_PREFIX . $name;
            //	break;
            case 'user_setting':
                if (!$id) {
                    throw new \InvalidArgumentException("You must pass the plugin id for user settings");
                }
                $name = ELGG_PLUGIN_USER_SETTING_PREFIX . "{$id}:{$name}";
                break;
            case 'internal':
                $name = ELGG_PLUGIN_INTERNAL_PREFIX . $name;
                break;
        }
        return $name;
    }