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 127)


	
			
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 ()
dbPrefs __construct ()
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 156)

Database connection object

integer $db_type = SMDB_UNKNOWN (line 169)

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 182)

Default preferences

string $error = NULL (line 162)

Error messages

string $identifier_quote_char = '' (line 176)

Character used to quote database table

and field names

string $key_field = 'prefkey' (line 144)

Field used to store preference name

integer $key_size = 64 (line 199)

Preference key field size

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

Table used to store preferences

string $user_field = 'user' (line 138)

Field used to store owner of preference

integer $user_size = 128 (line 192)

Preference owner field size

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

Field used to store preference value

integer $val_size = 65536 (line 206)

Preference value field size

  • since: 1.5.1
Methods
Constructor dbPrefs (line 237)

Constructor (PHP4 style, kept for compatibility reasons) initialize the default preferences array.

dbPrefs dbPrefs ()
Constructor __construct (line 215)

Constructor (PHP5 style, required in some future version of PHP) initialize the default preferences array.

dbPrefs __construct ()
deleteKey (line 440)

Delete user's prefs setting

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

Function used to handle database connection errors

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

Fill preference cache array

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

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 247)

initialize DB connection object

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

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 Fri, 20 Jan 2017 04:18:38 +0100 by phpDocumentor 1.4.3