|
KWeb
6.4
|
This class allows to quickly store and retrieve values in the database. More...
Public Member Functions | |
| __destruct () | |
| getName () | |
| getTitle () | |
| getInfo () | |
| initialize ($useSetup=true) | |
| load () | |
| loadDB () | |
| loadCache () | |
| saveCache () | |
| resetCache () | |
| getCacheFilename () | |
| store ($resetCache=false) | |
| markChanged ($name, $changed=true) | |
| Marks property as changed for database update. | |
| set ($name, $value) | |
| append ($name, $value) | |
| setRef ($name, &$value) | |
| reset ($name, $useDefault=true) | |
| Resets specified property. | |
| importArray ($data, $merge=false) | |
| setTimeLock ($name, $limit, $returnInterval=true) | |
| Safe time locker. | |
Static Public Member Functions | |
| static | instance ($_name, $create=true) |
| static | getFrom ($store, $name, $default=null) |
Static Public Attributes | |
| static | $instances = array() |
| static | $sets = array() |
| List of all available KDBSettings sets. | |
Protected Member Functions | |
| __construct ($_name) | |
Protected Attributes | |
| $_db = false | |
| $_changed = array() | |
| $_table | |
| $_set | |
| $_cache = true | |
| $_name | |
| Name of the instance. | |
This class allows to quickly store and retrieve values in the database.
Values are set and retrieved as object's properties
| KDBSettings::__construct | ( | $ | _name | ) | [protected] |
| KDBSettings::__destruct | ( | ) |
Reimplemented from KVarBase.
| KDBSettings::append | ( | $ | name, |
| $ | value | ||
| ) |
Reimplemented from KVarBase.
| KDBSettings::getCacheFilename | ( | ) |
| static KDBSettings::getFrom | ( | $ | store, |
| $ | name, | ||
| $ | default = null |
||
| ) | [static] |
| KDBSettings::getInfo | ( | ) |
Reimplemented in KWebDBSettings.
| KDBSettings::getName | ( | ) |
| KDBSettings::getTitle | ( | ) |
Reimplemented in KWebDBSettings.
| KDBSettings::importArray | ( | $ | data, |
| $ | merge = false |
||
| ) |
Reimplemented from KVarBase.
| KDBSettings::initialize | ( | $ | useSetup = true | ) |
| static KDBSettings::instance | ( | $ | _name, |
| $ | create = true |
||
| ) | [static] |
| KDBSettings::load | ( | ) |
| KDBSettings::loadCache | ( | ) |
| KDBSettings::loadDB | ( | ) |
| KDBSettings::markChanged | ( | $ | name, |
| $ | changed = true |
||
| ) |
Marks property as changed for database update.
| $changed | TRUE/FALSE - changed, NULL - unset |
| KDBSettings::reset | ( | $ | name, |
| $ | useDefault = true |
||
| ) |
Resets specified property.
If useDefault is TRUE, class's default value will be used, otherwise, the value will be unset
Reimplemented from KVarBase.
| KDBSettings::resetCache | ( | ) |
| KDBSettings::saveCache | ( | ) |
| KDBSettings::set | ( | $ | name, |
| $ | value | ||
| ) |
Reimplemented from KVarBase.
| KDBSettings::setRef | ( | $ | name, |
| &$ | value | ||
| ) |
Reimplemented from KVarBase.
| KDBSettings::setTimeLock | ( | $ | name, |
| $ | limit, | ||
| $ | returnInterval = true |
||
| ) |
Safe time locker.
Checks if the last lock have passed away, and sets a new lock. The lock is a setting value holding the current time in seconds. It's checked and updated in one single SQL query - making it thread safe.
| $name | - Name of the settings to use |
| $limit | - length of the limit in seconds |
| $returnInterval | - if true, the amount of seconds after last lock will be returned in result as $result['interval'] |
| KDBSettings::store | ( | $ | resetCache = false | ) |
KDBSettings::$_cache = true [protected] |
KDBSettings::$_changed = array() [protected] |
KDBSettings::$_db = false [protected] |
KDBSettings::$_name [protected] |
Name of the instance.
KDBSettings::$_set [protected] |
KDBSettings::$_table [protected] |
KDBSettings::$instances = array() [static] |
KDBSettings::$sets = array() [static] |
List of all available KDBSettings sets.