Class dbPrefs

Description

Class used to handle connections to prefs database and operations with preferences

  • since: 1.1.3

Located in /functions/db_prefs.php (line 93)


	
			
Variable Summary
object $dbh
integer $db_type
array $default
string $error
string $key_field
integer $key_size
string $table
string $user_field
integer $user_size
string $val_field
integer $val_size
Method Summary
dbPrefs dbPrefs ()
boolean deleteKey (string $user, string $key)
void failQuery ([object PEAR $res = NULL])
void fillPrefsCache (string $user)
mixed getKey (string $user, string $key, [mixed $default = ''])
boolean open ()
boolean setKey (string $user, string $key, mixed $value)
Variables
object $dbh = NULL (line 122)

Database connection object

integer $db_type = SMDB_UNKNOWN (line 135)

Database type (SMDB_* constants) Is used in setKey().

array $default = array('theme_default' => 0,
'include_self_reply_all' => '0',
'do_not_reply_to_self' => '1',
'show_html_default' => '0')
(line 141)

Default preferences

string $error = NULL (line 128)

Error messages

string $key_field = 'prefkey' (line 110)

Field used to store preference name

integer $key_size = 64 (line 158)

Preference key field size

  • since: 1.5.1
string $table = 'userprefs' (line 98)

Table used to store preferences

string $user_field = 'user' (line 104)

Field used to store owner of preference

integer $user_size = 128 (line 151)

Preference owner field size

  • since: 1.5.1
string $val_field = 'prefval' (line 116)

Field used to store preference value

integer $val_size = 65536 (line 165)

Preference value field size

  • since: 1.5.1
Methods
Constructor dbPrefs (line 173)

initialize the default preferences array.

dbPrefs dbPrefs ()
deleteKey (line 323)

Delete user's prefs setting

boolean deleteKey (string $user, string $key)
  • string $user: user name
  • string $key: preference name
failQuery (line 267)

Function used to handle database connection errors

void failQuery ([object PEAR $res = NULL])
  • object PEAR $res: Error object
fillPrefsCache (line 481)

Fill preference cache array

  • since: 1.2.3
void fillPrefsCache (string $user)
  • string $user: user name
getKey (line 288)

Get user's prefs setting

  • return: preference value
mixed getKey (string $user, string $key, [mixed $default = ''])
  • string $user: user name
  • string $key: preference name
  • mixed $default: (since 1.2.5) default value
open (line 196)

initialize DB connection object

  • return: true, if object is initialized
boolean open ()
setKey (line 356)

Set user's preference

boolean setKey (string $user, string $key, mixed $value)
  • string $user: user name
  • string $key: preference name
  • mixed $value: preference value

Documentation generated on Sat, 04 Jul 2015 04:17:29 +0200 by phpDocumentor 1.4.3