Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\SettingsArray Class Reference

Class representing a collection of settings. More...

+ Inheritance diagram for Wikibase\Lib\SettingsArray:
+ Collaboration diagram for Wikibase\Lib\SettingsArray:

Public Member Functions

 __construct (array $input=[])
 
 getSetting ( $settingName)
 Gets the value of the specified setting.
 
 setSetting ( $settingName, $settingValue)
 Sets the value of the specified setting.
 
 hasSetting ( $settingName)
 Returns if the specified settings is set or not.
 

Private Attributes

 $logger
 

Detailed Description

Class representing a collection of settings.

Note
: settings can be dynamic: if a setting is given as a closure, the closure will be called to get the actual setting value the first time this setting is retrieved using getSetting(). The closure is called with the SettingsArray as the only argument.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\SettingsArray::__construct ( array  $input = [])

Member Function Documentation

◆ getSetting()

Wikibase\Lib\SettingsArray::getSetting (   $settingName)

Gets the value of the specified setting.

Parameters
string$settingName
Exceptions
OutOfBoundsException
Returns
mixed

◆ hasSetting()

Wikibase\Lib\SettingsArray::hasSetting (   $settingName)

Returns if the specified settings is set or not.

Parameters
string$settingName
Returns
boolean

◆ setSetting()

Wikibase\Lib\SettingsArray::setSetting (   $settingName,
  $settingValue 
)

Sets the value of the specified setting.

Parameters
string$settingName
mixed$settingValueThe desired value. If this is a closure, the closure will be called to get the actual setting value the first time this setting is retrieved using getSetting(). The closure is called with this SettingsArray as the only argument.

Member Data Documentation

◆ $logger

Wikibase\Lib\SettingsArray::$logger
private

The documentation for this class was generated from the following file: