\midcom\dbaparameters

midcom parameter support

Summary

Methods
Properties
Constants
get_parameter()
list_parameters()
set_parameter()
delete_parameter()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
list_parameters_domain()
list_parameters_all()
$parameter_cache
$parameter_all
N/A

Properties

$parameter_cache

$parameter_cache : 

Type

$parameter_all

$parameter_all : 

Type

Methods

get_parameter()

get_parameter(string  $domain, string  $name) : string

Return a parameter from the database.

No event handlers are called here yet.

Parameters

string $domain

The parameter domain.

string $name

The parameter name.

Returns

string —

The parameter value or false otherwise (remember typesafe comparisons to protect against '' strings).

list_parameters()

list_parameters(string  $domain = null) : array

List the parameters of an object. This will either list the parameters of a single domain or the complete set of parameters, depending on the value of $domain.

It delegates the actual execution to two separate helper functions.

No event handlers are called here yet.

In case of a complete query, the result will be an associative array indexed by the domain name and containing another array with parameter name/value pairs. For example:

Array
(
    [Asgard] => Array
    (
        [lang] => en_US
        [act] => view
        [actloc] => tree
    )
    [AsgardTreeHost] => Array
    (
        [selected] => host0
    )
)

If you query only a single domain, the result will be a single associative array containing the parameter name/value pairs. For example:

Array
(
    [lang] => en_US
    [act] => view
    [actloc] => tree
)

In both cases an empty Array will indicate that no parameter was found, while false will indicate a failure while querying the database.

Parameters

string $domain

The parameter domain to query, this may be null to indicate a full listing.

Returns

array —

Parameter list (see above for details) or false on failure.

set_parameter()

set_parameter(string  $domain, string  $name, string  $value) : boolean

Set a parameter to the value specified.

This is either a create or an update operation depending on whether there was already a parameter of that domain/name present, or not.

The user needs both update and parameter manipulation permission on the parent object for updates.

Parameters

string $domain

The Parameter Domain.

string $name

The Parameter name.

string $value

The Parameter value. If this is empty, the corresponding parameter is deleted.

Returns

boolean —

Indicating success.

delete_parameter()

delete_parameter(string  $domain, string  $name) : boolean

Delete a parameter.

Current implementation note: Deletion is not yet implemented in MgdSchema. Therefore we set the parameters to an empty string for now, which should have almost the same effect for most cases and thus is good enough for now. Note, that empty string parameters are filtered in the getter methods until this matter is resolved.

The user needs both update and parameter manipulation permission on the parent object for updates.

Parameters

string $domain

The Parameter Domain.

string $name

The Parameter name.

Returns

boolean —

Indicating success.

list_parameters_domain()

list_parameters_domain(string  $domain) : array

List the parameters of a single domain of an object.

No event handlers are called here yet.

Parameters

string $domain

The parameter domain to query.

Returns

array —

Parameter listing.

list_parameters_all()

list_parameters_all() : array

List all parameters of an object.

No event handlers are called here yet.

Returns

array —

Parameter listing