Code Duplication    Length = 9-10 lines in 2 locations

engine/classes/ElggPlugin.php 2 locations

@@ 530-539 (lines=10) @@
527
	 * @param int $user_guid The user GUID to remove user settings.
528
	 * @return bool
529
	 */
530
	public function unsetAllUserSettings($user_guid) {
531
		$db_prefix = _elgg_services()->configTable->get('dbprefix');
532
		$ps_prefix = _elgg_namespace_plugin_private_setting('user_setting', '', $this->getID());
533
534
		$q = "DELETE FROM {$db_prefix}private_settings
535
			WHERE entity_guid = $user_guid
536
			AND name LIKE '$ps_prefix%'";
537
538
		return $this->getDatabase()->deleteData($q);
539
	}
540
541
	/**
542
	 * Removes this plugin's user settings for all users.
@@ 549-557 (lines=9) @@
546
	 *
547
	 * @return bool
548
	 */
549
	public function unsetAllUsersSettings() {
550
		$db_prefix = _elgg_services()->configTable->get('dbprefix');
551
		$ps_prefix = _elgg_namespace_plugin_private_setting('user_setting', '', $this->getID());
552
553
		$q = "DELETE FROM {$db_prefix}private_settings
554
			WHERE name LIKE '$ps_prefix%'";
555
556
		return $this->getDatabase()->deleteData($q);
557
	}
558
559
560
	// validation