Packageindex Classtrees Modulegroups Elementlist Report XML Files

Modules

Modules

private class Modules

 

Public Method Summary

object Modules &singleton()
Returns a reference to a single instance of this object
boolean isModule(string $module)
Checks to see if specified module is in directory.
void addModule(string $module, [ string $label ])
Add a module to the current configuration.
void setCapabilities(string $module, [ array $provides ])
Set the capabilities (or "what module provides") for specified module.
void addDependency(string $module, string $dep_module)
Specify that one module depends on another.
void setAttribute(string $module, string $attr_name, mixed $attr_value)
Add / set an attribute for a module.
mixed getAttribute(string $module, string $attr_name)
Get an attribute of a given module.
array aggregateAttribute(string $attr_name, [ array $modules ])
Returns a list of all specified attribute for all modules.
array findModules(string $attrib_name, mixed $attrib_value, [ boolean $strict ])
Returns a list of modules that match certain criteria.
void addCapability(string $module, string $action, [ string $label ])
Add a capability. This corresponds to the "Action" that can be performed
void removeCapability(string $module, string $action)
Remove a capability.
boolean hasCapability(string $module, string $action)
Checks whether a module provides a specified capability.
void regGenericModule(string $module)
Registers a module to use in case a request is made for a non-existant
string getGenericModule()
Gets the generic module if one has been established.

Private Method Summary

void Modules()
Initializes class variables.
void removeModule(string $module)
Removes a module from the stack.
void regFallbackProvider(string $requestedModule, string $providingModule, [ string $requestedAction ])
Registers a module to use as a functionality provider for the
string getFallbackProvider(string $requestedModule, [ string $requestedAction ])
Returns the name fo a fallback provider for the requested action, if one exist.
string getCapabilityProvider(string $capability, integer $datatype)
Returns the Module that provides a capability for a datatype.

Private Field Summary

$genericModule
The name of a module to use as a generic module. (if requested
array $modules
The registered modules.
array $fallbackProviders
Modules that can provide functionality for other modules.

Public Method Details

&singleton

public object Modules &singleton()

 

Returns object Modules

reference


isModule

public boolean isModule(string $module)

 

Parameter
string $module
Returns boolean


addModule

public void addModule(string $module, [ string $label ])

  Pushing a module w/ same name as a module already on the stack will overwrite the first one.

Parameter
string $module
The name of the module we are adding.
string $label = >>''<<
Display name for the module
Returns void


setCapabilities

public void setCapabilities(string $module, [ array $provides ])

  Omitting the second param, or passing a null param will result in emptying the array.

Parameter
string $module
The module name.
array $provides = >>null<<
The array of capabilities -- e.g. 'list', 'detail', etc. that module provides.
Returns void


addDependency

public void addDependency(string $module, string $dep_module)

  This method doesn't really do anything (i.e. doesn't return an error).

Parameter
string $module
The module that depends.
string $dep_module
The module that is depended on.
Returns void


setAttribute

public void setAttribute(string $module, string $attr_name, mixed $attr_value)

  This is a catchall for handling useful attributes of modules that we don't want to have separate methods for -- e.g. 'visible' or 'application' etc.

Parameter
string $module
The module name for which we are setting an attrib.
string $attr_name
The attribute name that we are setting.
mixed $attr_value
The value for the attribute.
Returns void


getAttribute

public mixed getAttribute(string $module, string $attr_name)

  Used in conjunction / as the counterpart to setAttribute.

Parameter
string $module
The module name for which we are getting an attrib.
string $attr_name
The attribute name that we are getting.
Returns mixed

The value of the $attr_name attribute or null.


aggregateAttribute

public array aggregateAttribute(string $attr_name, [ array $modules ])

 

Parameter
string $attr_name
The attribute name.
array $modules = >>null<<
Can specify subset of modules within which to aggregate specified attribute.
Returns array

attributes


findModules

public array findModules(string $attrib_name, mixed $attrib_value, [ boolean $strict ])

  This will start out being very simple -- pass it an attribute name and value, and it will return all matching Module keys (which are by definition unique).

Parameter
string $attrib_name
The attribute to search for.
mixed $attrib_value
The value of the attribute to match.
boolean $strict = >>false<<
Whether to also match type.
Returns array

The module keys (module names) that match the search.


addCapability

public void addCapability(string $module, string $action, [ string $label ])

  on a given module, and is expected to translate into a filesystem file (PHP script)

Parameter
string $module
The module name.
string $action
The capability -- e.g. 'list', 'detail', etc. that module provides.
string $label = >>null<<
A label for the module
Returns void


removeCapability

public void removeCapability(string $module, string $action)

 

Parameter
string $module
The module name.
string $action
The capability -- e.g. 'list', 'detail', etc. that module provides.
Returns void


hasCapability

public boolean hasCapability(string $module, string $action)

  (whether module supports specified action)

Parameter
string $module
Module name.
string $action
The action to look for in module's 'provides' array.
Returns boolean


regGenericModule

public void regGenericModule(string $module)

  module, or there is an attempt to perform a non-existant action

Parameter
string $module
The module to use for requests that do not exist.
Returns void


getGenericModule

public string getGenericModule()

 

Returns string

The name of the generic module.


Private Method Details

Modules

private void Modules()

 

Returns void


removeModule

private void removeModule(string $module)

 

Parameter
string $module
The name of the module to remove.
Returns void


regFallbackProvider

private void regFallbackProvider(string $requestedModule, string $providingModule, [ string $requestedAction ])

  specified module, in the even that the module is called to perform an unsupported action/capability. This is still very basic, and could be made more complex by allowing modules to use functionality from certain modules for certain actions. Also -- there is the issue of module templates....

Parameter
string $requestedModule
The module that was requested (and will be incomplete)
string $providingModule
The module that can provide that same functionality.
string $requestedAction = >>null<<
If specified will specify that fallback only applies for specified action.
Returns void


getFallbackProvider

private string getFallbackProvider(string $requestedModule, [ string $requestedAction ])

 

Parameter
string $requestedModule
string $requestedAction = >>null<<
Returns string

Fallback provider -- or NULL if none found.


getCapabilityProvider

private string getCapabilityProvider(string $capability, integer $datatype)

 

Parameter
string $capability
, Capability name
integer $datatype
, datatype
Returns string


Private Field Details

$genericModule

private $genericModule

>>null<<

module does not exist)


$modules

private array $modules

>><<


$fallbackProviders

private array $fallbackProviders

>><<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:06:12 -0400 by PHPDoc v1.5 www.phpdoc.de