\coreOptions

The Options class contains convenience functions around option handling. It is implemented as a singleton to prevent excessive DB requests; its content never changes during a script run.

Summary

Methods
Properties
Constants
instance()
__clone()
availableOptions()
optionType()
assertValidOptionName()
No public properties found
TYPECODE_STRING
TYPECODE_INTEGER
TYPECODE_TEXT
TYPECODE_BOOLEAN
TYPECODE_FILE
TYPECODE_COORDINATES
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TYPECODE_STRING

TYPECODE_STRING = string

TYPECODE_INTEGER

TYPECODE_INTEGER = integer

TYPECODE_TEXT

TYPECODE_TEXT = text

TYPECODE_BOOLEAN

TYPECODE_BOOLEAN = boolean

TYPECODE_FILE

TYPECODE_FILE = file

TYPECODE_COORDINATES

TYPECODE_COORDINATES = coordinates

Methods

instance()

instance() : \core\Options

Returns the handle to the (only) instance of this class.

Returns

\core\Options —

__clone()

__clone() : 

Prevent cloning - this is a singleton.

Returns

availableOptions()

availableOptions(  className) : mixed|string|int

This function lists all known options. If called with the optional parameter $className, only options of that class are returned, otherwise the full set of all known attributes.

Parameters

className

optionally specifies the class of options to be listed (class is the part of the option name before the : sign)

Returns

mixed|string|int —

of options

optionType()

optionType(  optionname) : mixed|string|int

This function returns the properties of a given attribute name. This currently means it returns its type and its flag field ("ML").

Parameters

optionname

Name of the option whose properties are to be retrieved.

Returns

mixed|string|int —

properties of the attribute

assertValidOptionName()

assertValidOptionName(  unvettedName) : 

This function is mostly useless. It takes an (unvetted) string, sees if it is a valid option name, and then returns the array key of the typeDb instead of the unvetted string. This makes Scrutinizer happy.

Parameters

unvettedName

the input name

Returns

the name echoed back, but from trusted source