ElggPlugin::unsetAllSettings PHP Method

unsetAllSettings() public method

Removes all settings for this plugin.
public unsetAllSettings ( ) : boolean
return boolean
    public function unsetAllSettings()
    {
        _elgg_services()->pluginSettingsCache->clear($this->guid);
        _elgg_services()->boot->invalidateCache();
        $db_prefix = _elgg_services()->configTable->get('dbprefix');
        $us_prefix = _elgg_namespace_plugin_private_setting('user_setting', '', $this->getID());
        $is_prefix = _elgg_namespace_plugin_private_setting('internal', '', $this->getID());
        $q = "DELETE FROM {$db_prefix}private_settings\n\t\t\tWHERE entity_guid = {$this->guid}\n\t\t\tAND name NOT LIKE '{$us_prefix}%'\n\t\t\tAND name NOT LIKE '{$is_prefix}%'";
        return $this->getDatabase()->deleteData($q);
    }