Package | org.spicefactory.parsley.context |
Class | public class ServiceBuilder |
Inheritance | ServiceBuilder Object |
Method | Defined By | ||
---|---|---|---|
addDecorator(type:Class, ... params):ContextBuilderSetup
Adds a decorator for this service. | ServiceBuilder | ||
setImplementation(type:Class, ... params):ContextBuilderSetup
Sets the implementation for this service, replacing the existing registration. | ServiceBuilder |
addDecorator | () | method |
public function addDecorator(type:Class, ... params):ContextBuilderSetup
Adds a decorator for this service. Decorating services is the recommended way of adding funcitonality to the kernel services, as it allows to stack multiple third party decorators without overriding each others extension. The decorator class must implement the same interface as the decorated service and come with a constructor that accepts the decorated service as the first parameter. If you pass additional parameters to this method they must be added as additional constructor parameters after this required first parameter.
Parameters
type:Class — the implementation type of the service
| |
... params — the parameters to pass to the constructor of the decorator, after the first parameter which is
always the decorated service itself
|
ContextBuilderSetup — the original setup instance for method chaining
|
setImplementation | () | method |
public function setImplementation(type:Class, ... params):ContextBuilderSetup
Sets the implementation for this service, replacing the existing registration.
Parameters
type:Class — the implementation type of the service
| |
... params — the parameters to pass to the constructor of the service
|
ContextBuilderSetup — the original setup instance for method chaining
|