tWithOptions
MMO\core\classes · 1 symbol · generated 5 Oct 2026
tWithOptions
tWithOptions.php:13Gives a class a simple key/value "options" bag (e.g. request options: headers, timeouts, ...), backed by a single protected $opts array.
- Namespace
MMO\core\classes
Index
| opts | ||
| addOptions($opts, $appendList) | Merge $opts into the existing options (through merge), rather than replacing them wholesale like setOptions. | |
| clearOptions() | Empty the options bag. | |
| getOption($key, $default) | ||
| getOptions() | ||
| setOption($key, $value) | Set (or, with a null $value, remove) a single option. | |
| setOptions($opts) | Replace the whole options bag. |
Properties1
opts
- Type
- array
Methods6
addOptions($opts, $appendList)
tWithOptions.php:65Merge $opts into the existing options (through merge), rather than replacing them wholesale like setOptions.
| $opts | array | the options to merge in |
| $appendList = false | bool | if true, a list-valued option is appended to (rather than replaced by) the corresponding list in $opts -- see \MMO\core\arrays\merge for the exact semantics |
| returns | void |
clearOptions()
tWithOptions.php:39Empty the options bag.
| returns | void |
getOption($key, $default)
tWithOptions.php:49getOptions()
tWithOptions.php:20| returns | array | every option currently set |
setOption($key, $value)
tWithOptions.php:77Set (or, with a null $value, remove) a single option.
setOptions($opts)
tWithOptions.php:30Replace the whole options bag.