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,
'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 156)

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

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

Preference value field size

  • since: 1.5.1
Methods
Constructor dbPrefs (line 171)

initialize the default preferences array.

dbPrefs dbPrefs ()
deleteKey (line 321)

Delete user's prefs setting

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

Function used to handle database connection errors

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

Fill preference cache array

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

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

initialize DB connection object

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

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 Sun, 31 Aug 2014 04:17:38 +0200 by phpDocumentor 1.4.3