Piwik\Settings\Storage\Backend\PluginSettingsTable::removeAllUserSettingsForUser PHP Method

removeAllUserSettingsForUser() public static method

Unsets all settings for a user. The settings will be removed from the database. Used when a user is deleted.
public static removeAllUserSettingsForUser ( string $userLogin )
$userLogin string
    public static function removeAllUserSettingsForUser($userLogin)
    {
        if (empty($userLogin)) {
            throw new Exception('No userLogin specified. Cannot remove all settings for this user');
        }
        $table = Common::prefixTable('plugin_setting');
        Db::get()->query(sprintf('DELETE FROM %s WHERE user_login = ?', $table), array($userLogin));
    }

Usage Example

Esempio n. 1
0
 public function cleanupUser($userLogin)
 {
     PluginSettingsTable::removeAllUserSettingsForUser($userLogin);
 }