Database data helper class

access public
package kocuj_internal_lib

 Methods

Add option for network or site

addOption(string $name, array|boolean|float|integer|string $value, integer $optionAutoload = \KocujIL\V12a\Enums\OptionAutoload::NO, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Option name

$value

arraybooleanfloatintegerstring

Option value

$optionAutoload

integer

Automatic loading of option or not; must be one of the following constants from \KocujIL\V12a\Enums\OptionAutoload: NO (when option should not be automatically loaded) or YES (when option should be automatically loaded) - default: \KocujIL\V12a\Enums\OptionAutoload::NO

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Add or update option for network or site

addOrUpdateOption(string $name, array|boolean|float|integer|string $value, integer $optionAutoload = \KocujIL\V12a\Enums\OptionAutoload::NO, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Option name

$value

arraybooleanfloatintegerstring

Option value

$optionAutoload

integer

Automatic loading of option or not; must be one of the following constants from \KocujIL\V12a\Enums\OptionAutoload: NO (when option should not be automatically loaded) or YES (when option should be automatically loaded) - default: \KocujIL\V12a\Enums\OptionAutoload::NO

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Add or update transient for network or site

addOrUpdateTransient(string $name, array|boolean|float|integer|string $value, integer $expiration = 0, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Transient name

$value

arraybooleanfloatintegerstring

Transient value

$expiration

integer

Expiration in seconds - default: 0

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Add transient for network or site

addTransient(string $name, array|boolean|float|integer|string $value, integer $expiration = 0, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Transient name

$value

arraybooleanfloatintegerstring

Transient value

$expiration

integer

Expiration in seconds - default: 0

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

End database transaction

databaseTransactionEnd() : void
access public

Start database transaction

databaseTransactionStart() : void
access public

Delete option for network or site

deleteOption(string $name, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Option name

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Delete transient for network or site

deleteTransient(string $name, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Transient name

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Get singleton instance

getInstance() : object
Static
access public

Returns

objectSingleton instance

Get option value for network or site

getOption(string $name, array|boolean|float|integer|string $defaultOptionValue = false, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : array | boolean | float | integer | string
access public

Parameters

$name

string

Option name

$defaultOptionValue

arraybooleanfloatintegerstring

Default option value - default: false

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Returns

arraybooleanfloatintegerstringOption value

Get transient value for network or site

getTransient(string $name, array|boolean|float|integer|string $defaultTransientValue = false, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : array | boolean | float | integer | string
access public

Parameters

$name

string

Transient name

$defaultTransientValue

arraybooleanfloatintegerstring

Default transient value - default: false

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Returns

arraybooleanfloatintegerstringTransient value

Merge element to option array for network or site

mergeOptionArray(string $name, string $key, array|boolean|float|integer|string $value, integer $optionAutoload = \KocujIL\V12a\Enums\OptionAutoload::NO, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : boolean
access public

Parameters

$name

string

Option name

$key

string

Option element key

$value

arraybooleanfloatintegerstring

Option element value

$optionAutoload

integer

Automatic loading of option or not; must be one of the following constants from \KocujIL\V12a\Enums\OptionAutoload: NO (when option should not be automatically loaded) or YES (when option should be automatically loaded) - default: \KocujIL\V12a\Enums\OptionAutoload::NO

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Returns

booleanElement has been merged correctly (true) or not (false)

Merge element to transient array for network or site

mergeTransientArray(string $name, string $key, array|boolean|float|integer|string $value, integer $expiration = 0, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : boolean
access public

Parameters

$name

string

Transient name

$key

string

Transient element key

$value

arraybooleanfloatintegerstring

Transient element value

$expiration

integer

Expiration in seconds - default: 0

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Returns

booleanElement has been merged correctly (true) or not (false)

Unmerge element to option array for network or site

unmergeOptionArray(string $name, string $key, integer $optionAutoload = \KocujIL\V12a\Enums\OptionAutoload::NO, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : boolean
access public

Parameters

$name

string

Option name

$key

string

Option element key

$optionAutoload

integer

Automatic loading of option or not; must be one of the following constants from \KocujIL\V12a\Enums\OptionAutoload: NO (when option should not be automatically loaded) or YES (when option should be automatically loaded) - default: \KocujIL\V12a\Enums\OptionAutoload::NO

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Returns

booleanElement has been merged correctly (true) or not (false)

Unmerge element to transient array for network or site

unmergeTransientArray(string $name, string $key, integer $expiration = 0, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : boolean
access public

Parameters

$name

string

Transient name

$key

string

Transient element key

$expiration

integer

Expiration in seconds - default: 0

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Returns

booleanElement has been merged correctly (true) or not (false)

Update option for network or site

updateOption(string $name, array|boolean|float|integer|string $value, integer $optionAutoload = \KocujIL\V12a\Enums\OptionAutoload::NO, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Option name

$value

arraybooleanfloatintegerstring

Option value

$optionAutoload

integer

Automatic loading of option or not; must be one of the following constants from \KocujIL\V12a\Enums\OptionAutoload: NO (when option should not be automatically loaded) or YES (when option should be automatically loaded) - default: \KocujIL\V12a\Enums\OptionAutoload::NO

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Update transient for network or site

updateTransient(string $name, array|boolean|float|integer|string $value, integer $expiration = 0, integer $area = \KocujIL\V12a\Enums\Area::AUTO) : void
access public

Parameters

$name

string

Transient name

$value

arraybooleanfloatintegerstring

Transient value

$expiration

integer

Expiration in seconds - default: 0

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area) - default: \KocujIL\V12a\Enums\Area::AUTO

Disable cloning of object

__clone() : void
access private

Constructor

__construct() : void
access private

Add option or transient for network or site

add(boolean $isOption, string $name, array|boolean|float|integer|string $value, boolean|integer $autoloadOrExpiration, integer $area) : void
access private

Parameters

$isOption

boolean

It is option (true) or transient (false)

$name

string

Option or transient name

$value

arraybooleanfloatintegerstring

Option or transient value

$autoloadOrExpiration

booleaninteger

For option it sets automatic loading of option (true) or not (false) and works only if option is for site, not network; for transient it is expiration in seconds

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area)

Call function

callFunction(boolean $isOption, string $prefix, array $pars, integer $area) : array | boolean | float | integer | string
access private

Parameters

$isOption

boolean

It is option (true) or transient (false)

$prefix

string

Function name prefix

$pars

array

Function parameters

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area)

Returns

arraybooleanfloatintegerstringReturned value

Check if area is set to network

checkAreaNetwork(integer $area) : boolean
access private

Parameters

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area)

Returns

booleanArea is set to network (true) or not (false)

Delete option or transient for network or site

delete(boolean $isOption, string $name, integer $area) : void
access private

Parameters

$isOption

boolean

It is option (true) or transient (false)

$name

string

Option or transient name

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area)

Get option or transient for network or site

get(boolean $isOption, string $name, array|boolean|float|integer|string $defaultValue, integer $area) : array | boolean | float | integer | string
access private

Parameters

$isOption

boolean

It is option (true) or transient (false)

$name

string

Option or transient name

$defaultValue

arraybooleanfloatintegerstring

Default option or transient value

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area)

Returns

arraybooleanfloatintegerstringOption or transient value

Merge or unmerge element to option or transient array for network or site

mergeOrUnmerge(boolean $isOption, boolean $merge, string $name, string $key, array|boolean|float|integer|string $value, boolean|integer $autoloadOrExpiration, integer $area) : boolean
access private

Parameters

$isOption

boolean

It is option (true) or transient (false)

$merge

boolean

Merge (true) or unmerge (false)

$name

string

Option or transient name

$key

string

Option or transient element key

$value

arraybooleanfloatintegerstring

Option or transient element value

$autoloadOrExpiration

booleaninteger

For option it sets automatic loading of option (true) or not (false) and works only if option is for site, not network; for transient it is expiration in seconds

$area

integer

Option or transient area; must be one of the following constants from \KocujIL\V12a\Enums\Area: AUTO (for automatic area), SITE (for site area) or NETWORK (for network area)

Returns

booleanElement has been merged correctly (true) or not (false)

 Properties

 

Singleton instance

$instance : object

Default

NULL
Static
access private