@@ 587-596 (lines=10) @@ | ||
584 | * @param int $user_guid The user GUID to remove user settings. |
|
585 | * @return bool |
|
586 | */ |
|
587 | public function unsetAllUserSettings($user_guid) { |
|
588 | $db = $this->getDatabase(); |
|
589 | $ps_prefix = _elgg_namespace_plugin_private_setting('user_setting', '', $this->getID()); |
|
590 | ||
591 | $q = "DELETE FROM {$db->prefix}private_settings |
|
592 | WHERE entity_guid = $user_guid |
|
593 | AND name LIKE '$ps_prefix%'"; |
|
594 | ||
595 | return $db->deleteData($q); |
|
596 | } |
|
597 | ||
598 | /** |
|
599 | * Removes this plugin's user settings for all users. |
|
@@ 606-614 (lines=9) @@ | ||
603 | * |
|
604 | * @return bool |
|
605 | */ |
|
606 | public function unsetAllUsersSettings() { |
|
607 | $db = $this->getDatabase(); |
|
608 | $ps_prefix = _elgg_namespace_plugin_private_setting('user_setting', '', $this->getID()); |
|
609 | ||
610 | $q = "DELETE FROM {$db->prefix}private_settings |
|
611 | WHERE name LIKE '$ps_prefix%'"; |
|
612 | ||
613 | return $db->deleteData($q); |
|
614 | } |
|
615 | ||
616 | ||
617 | // validation |