Class SGL_ServiceLocator

Description

A class that allows services to be globally registered, so that they can be accessed by any class that needs them. Also allows Mock Objects to be easily used as replacements for classes during testing.

Located in /SGL/DB.php (line 341)


	
			
Variable Summary
 mixed $aServices
Method Summary
 static mixed &staticGet (string $serviceName)
 mixed &get (string $serviceName)
 boolean register (string $serviceName,  &$oService, mixed $oService)
 void remove (string $serviceName)
 void &singleton ()
Variables
mixed $aServices = array() (line 343)
Methods
static staticGet (line 406)

A method to return a registered service.

  • return: Either the service object requested, or false if the requested service was not registered.
mixed &staticGet (string $serviceName)
  • string $serviceName: The name of the service required.
get (line 388)

A method to return a registered service.

  • return: Either the service object requested, or false if the requested service was not registered.
mixed &get (string $serviceName)
  • string $serviceName: The name of the service required.
register (line 365)

A method to register a service with the service locator class.

  • return: Always returns true.
boolean register (string $serviceName,  &$oService, mixed $oService)
  • string $serviceName: The name of the service being registered.
  • mixed $oService: The object (service) being registered.
  • &$oService
remove (line 376)

A method to remove a registered service from the service locator class.

void remove (string $serviceName)
  • string $serviceName: The name of the service being de-registered.
singleton (line 348)

A method to return a singleton handle to the service locator class.

void &singleton ()

Documentation generated on Tue, 23 Feb 2010 18:14:29 +0000 by phpDocumentor 1.4.3