summaryrefslogtreecommitdiffstats
path: root/lib/preferences.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/preferences.php')
-rw-r--r--lib/preferences.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/preferences.php b/lib/preferences.php
index 6270457834d..5f6434bcf9c 100644
--- a/lib/preferences.php
+++ b/lib/preferences.php
@@ -114,7 +114,8 @@ class OC_Preferences{
*/
public static function getValue( $user, $app, $key, $default = null ) {
// Try to fetch the value, return default if not exists.
- $query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
+ $query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*preferences`'
+ .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
$result = $query->execute( array( $user, $app, $key ));
$row = $result->fetchRow();
@@ -138,16 +139,19 @@ class OC_Preferences{
*/
public static function setValue( $user, $app, $key, $value ) {
// Check if the key does exist
- $query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
+ $query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*preferences`'
+ .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
$values=$query->execute(array($user, $app, $key))->fetchAll();
$exists=(count($values)>0);
if( !$exists ) {
- $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*preferences` ( `userid`, `appid`, `configkey`, `configvalue` ) VALUES( ?, ?, ?, ? )' );
+ $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*preferences`'
+ .' ( `userid`, `appid`, `configkey`, `configvalue` ) VALUES( ?, ?, ?, ? )' );
$query->execute( array( $user, $app, $key, $value ));
}
else{
- $query = OC_DB::prepare( 'UPDATE `*PREFIX*preferences` SET `configvalue` = ? WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
+ $query = OC_DB::prepare( 'UPDATE `*PREFIX*preferences` SET `configvalue` = ?'
+ .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
$query->execute( array( $value, $user, $app, $key ));
}
return true;
@@ -164,7 +168,8 @@ class OC_Preferences{
*/
public static function deleteKey( $user, $app, $key ) {
// No need for more comments
- $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
+ $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*preferences`'
+ .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
$query->execute( array( $user, $app, $key ));
return true;