A generic holder for a set of options built on top of baseSet. Allows for objects to implement an options system easily and quickly. Options are an associative array of option.name => value pairs. Options can be set via either the constructor at creation, or later via setOptions.
$oOptions = new baseOptionsSet(
array(
'option1' => true,
'option.2' => 'a string',
'some.other.value' => 123456,
)
);
$val = $oOptions->getOptions('option1');
echo $val; // outputs 1 (true)
public __construct([$inOptions = array()])
Creates a new options set
public reset()
Reset object
public getOptions([$inOption = null], [$inDefault = null])
Returns options or a specific option, null if not found
public setOptions([$inOptions = array()])
Set options to $inOptions
$inOptions should be an array containing the key value pairs of options.
public removeOptions([$inOptions = array()])
Removes specified options from set
$inOptions should be an array containing the keys only
Posted by: Scorpio Documentor (Writer), in Base on 19 Nov 2009 @ 20:30
Tags: base, baseoptionsset, baseset, countable, iteratoraggregate, traversable,
This
work is licenced under a
Creative Commons Licence.