KWeb  6.4
KDBSettings Class Reference

This class allows to quickly store and retrieve values in the database. More...

Inheritance diagram for KDBSettings:
KVarBase KDBSettings_strings KWebDBSettings KWebDBSettings_aggregators KWebDBSettings_cron KWebDBSettings_edit KWebDBSettings_mail KWebDBSettings_search KWebDBSettings_synch KWebDBSettings_tmpl KWebDBSettings_version

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.

Detailed Description

This class allows to quickly store and retrieve values in the database.

Values are set and retrieved as object's properties


Constructor & Destructor Documentation

KDBSettings::__construct ( _name) [protected]
KDBSettings::__destruct ( )

Reimplemented from KVarBase.


Member Function Documentation

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]
Returns:
KDBSettings
KDBSettings::load ( )
KDBSettings::loadCache ( )
KDBSettings::loadDB ( )
KDBSettings::markChanged ( name,
changed = true 
)

Marks property as changed for database update.

Parameters:
$changedTRUE/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.

Parameters:
$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']
Returns:
array('locked' => true if last lock is still valid, 'interval'=> see $returnInterval);
KDBSettings::store ( resetCache = false)

Field Documentation

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.


The documentation for this class was generated from the following file: