Erebot  latest
A modular IRC bot for PHP 5.3+
Erebot\Config\Module Class Reference

This class stores configuration data about modules. More...

+ Inheritance diagram for Erebot\Config\Module:

Public Member Functions

 __construct (\SimpleXMLElement $xml)
 
 __destruct ()
 
 getName ()
 
 getParam ($param)
 
 getParamsNames ()
 
 isActive ($active=null)
 

Protected Attributes

 $active
 A boolean indicating whether the module is active or not.
 
 $name
 The name of the module.
 
 $params
 A dictionary mapping parameter names to their textual value.
 

Detailed Description

This class stores configuration data about modules.

For each module at any configuration level, an instance of Erebot::Config::Module will be created.

Definition at line 30 of file Module.php.

Constructor & Destructor Documentation

Erebot\Config\Module::__construct ( \SimpleXMLElement  $xml)

Creates a new configuration object for a module.

Parameters
SimpleXMLElement$xmlAn XML node containing the configuration settings for the module.

Definition at line 48 of file Module.php.

References Erebot\Config\Module\$active.

Erebot\Config\Module::__destruct ( )

Destructor.

Definition at line 69 of file Module.php.

Member Function Documentation

Erebot\Config\Module::getName ( )

Returns the name of this module.

Return values
stringThe name of the module represented by this module configuration.

Implements Erebot\Interfaces\Config\Module.

Definition at line 89 of file Module.php.

References Erebot\Config\Module\$name.

Erebot\Config\Module::getParam (   $param)

Returns the value for the given parameter.

Parameters
string$paramThe name of the parameter we are interested in.
Return values
stringThe value of the parameter.
Exceptions
Erebot::InvalidValueExceptionThe $param argument was not a valid parameter name.
Erebot::NotFoundExceptionThere was no parameter with this name defined in the configuration file.

Implements Erebot\Interfaces\Config\Module.

Definition at line 95 of file Module.php.

Erebot\Config\Module::getParamsNames ( )

Returns the names of the parameters for this module.

Return values
arrayA list with the names (as strings) of the parameters configured for this module.

Implements Erebot\Interfaces\Config\Module.

Definition at line 107 of file Module.php.

Erebot\Config\Module::isActive (   $active = null)

Gets/sets the active flag on this module.

Parameters
null | bool$activeAn optional parameter which can be used to change the value of the active flag for this module.
Return values
boolThe value of the active flag as it was before this method was called.
Exceptions
Erebot::InvalidValueExceptionThe new value for the active flag is not a valid boolean value.

Implements Erebot\Interfaces\Config\Module.

Definition at line 74 of file Module.php.

References Erebot\Config\Module\$active.


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