Public Method Details |
pxdb_prefs |
public void pxdb_prefs()
|
|
|
Returns |
void |
|
&singleton |
public object pxdb_prefs &singleton()
|
|
Will create a new prefs class only if one does not already exist.
|
Returns |
object pxdb_prefs or false on error. |
|
get_pref |
public mixed get_pref(string $pname, [ mixed $pkey ])
|
|
Will look for a lowercase version of pref_name and pref_key unless $case_sensitive is true. (note: pref_name and pref_key will also have been made lowercase by set_pref() method)
|
Parameter |
|
string |
$pname |
|
|
The name of the preference to retrieve |
|
|
mixed |
$pkey |
= >>null<< |
|
The [optional] key of the preference to retrieve |
|
Returns |
mixed Contents of the pref |
|
clear_cache |
public void clear_cache()
|
|
Useful if you want to update & retrieve [updated] prefs in the same page. In that case you may also just want to disable caching -- depending on how many times you are going to access the same preferences.
|
Returns |
void |
|
get_array |
public array get_array(string $pname, [ string $pkey ])
|
|
get_pref() method will only return an array if there is more than one matching preference. This method will always return an array -- even if there is only one matching pref.
|
Parameter |
|
string |
$pname |
|
|
The name of the preference to retrieve |
|
|
string |
$pkey |
= >>null<< |
|
The [optional] key of the preference to retrieve |
|
Returns |
array The matching preference(s) |
|
get_hash |
public array get_hash(string $pname, [ string $pkey ])
|
|
Get_array returns only the values in an array. preference. This method will always return an array -- even if there is only one matching pref.
|
Parameter |
|
string |
$pname |
|
|
The name of the preference to retrieve |
|
|
string |
$pkey |
= >>null<< |
|
The [optional] key of the preference to retrieve |
|
Returns |
array The matching preference(s) |
|
get_list |
public string get_list(string $pname, [ string $pkey, string $delim ])
|
|
|
Parameter |
|
string |
$pname |
|
|
The name of preference |
|
|
string |
$pkey |
= >>null<< |
|
The preference key. |
|
|
string |
$delim |
= >>','<< |
|
the delimter with which to separate multiple preferences. |
|
Returns |
string $delim The -separated string of preferences. |
|
del_pref |
public void del_pref(string $pname, [ string $pkey, string $pval ])
|
|
Matches on normalized pref_name and pref_key, unless pref_key is null in which case it removes all prefs that match pref_name.
|
Parameter |
|
string |
$pname |
|
|
Name of pref to delete. |
|
|
string |
$pkey |
= >>null<< |
|
Key of pref to delete. |
|
|
string |
$pval |
= >>null<< |
|
Value of pref to delete (in cases where there is more than one name/key match to a preference). |
|
Returns |
void |
|
set_pref |
public void set_pref(string $pname)
|
|
This method calls the del_pref() and add_pref() methods.
|
Parameter |
|
string |
$pname |
|
|
The name of preference to set. |
|
Returns |
void |
|
add_pref |
public void add_pref(string $pname)
|
|
Will automatically lowercase the pref_name and pref_key unless $case_sensitive is true.
|
Parameter |
|
string |
$pname |
|
|
Name of preference to add. |
|
Returns |
void |
|
set_default_pref |
public void set_default_pref(string $pname)
|
|
It first checks to make sure there isn't a preference already loaded, if not, it writes it to the database.
|
Parameter |
|
string |
$pname |
|
|
Name of preference to add. |
|
Returns |
void |
|