summaryrefslogtreecommitdiffstats
path: root/lib/public/config.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-02 15:54:34 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 15:54:34 +0200
commit82a61e2e1a0f392759b69f7336213ff70a7bc877 (patch)
treea78094228b8454feb9212c2b7c3f54f5427fc03c /lib/public/config.php
parentff66600bc060dd2713b88b4af88e5a0a291710e0 (diff)
downloadnextcloud-server-82a61e2e1a0f392759b69f7336213ff70a7bc877.tar.gz
nextcloud-server-82a61e2e1a0f392759b69f7336213ff70a7bc877.zip
port oc_preferences
Diffstat (limited to 'lib/public/config.php')
-rw-r--r--lib/public/config.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/public/config.php b/lib/public/config.php
index cbc7d916cf4..5681f20e3b3 100644
--- a/lib/public/config.php
+++ b/lib/public/config.php
@@ -92,6 +92,41 @@ class Config {
}
+ /**
+ * @brief Gets the preference
+ * @param $user user
+ * @param $app app
+ * @param $key key
+ * @param $default = null, default value if the key does not exist
+ * @returns the value or $default
+ *
+ * This function gets a value from the prefernces table. If the key does
+ * not exist the default value will be returnes
+ */
+ public static function getUserValue( $user, $app, $key, $default = null ){
+ return(\OC_Preferences::getValue( $user, $app, $key, $default ));
+ }
+
+
+ /**
+ * @brief sets a value in the preferences
+ * @param $user user
+ * @param $app app
+ * @param $key key
+ * @param $value value
+ * @returns true/false
+ *
+ * Adds a value to the preferences. If the key did not exist before, it
+ * will be added automagically.
+ */
+ public static function setUserValue( $user, $app, $key, $value ){
+ return(\OC_Preferences::setValue( $user, $app, $key, $value ));
+ }
+
+
+
+
+
}