\PhileServiceLocator

the Service Locator class

Summary

Methods
Properties
Constants
registerService()
hasService()
getService()
No public properties found
No constants found
No protected methods found
$services
$serviceMap
N/A
No private methods found
No private properties found
N/A

Properties

$services

$services : array

Type

array — of services

$serviceMap

$serviceMap : array

Type

array — for mapping speaking names/keys to the interfaces

Methods

registerService()

registerService(string $serviceKey, mixed $object)

method to register a service

Parameters

string $serviceKey

the key for the service

mixed $object

Throws

\Phile\Exception

hasService()

hasService(string $serviceKey) : bool

checks if a service is registered

Parameters

string $serviceKey

Returns

bool

getService()

getService(string $serviceKey) : mixed

returns a service

Parameters

string $serviceKey

the service key

Throws

\Phile\Exception

Returns

mixed