Service
Example
tramway create:service ProductService --dependencies repository.product
Will add a new Service file with a constructor featuring dependency mapping for dependency injection.
Options
Argument | Command Type | Type | Default | Required | Comments |
---|---|---|---|---|---|
name | argument | string | none | yes | The name of the Service class |
dir | option | string | services | no | An option to override the default folder the Service class will be created in |
dependencies | option | array | none | no | An array of dependencies the Service will have |
add-dependency-injection | option | boolean | false | no | A flag to indicate that a service declaration should be created when making the Service |
key | option | string | none | no | The name of the key to use in dependency injection configuration |
dependency-injection-dir | option | string | services | no | An option to override the default folder where the service config will be placed |
dependency-injection-filename | option | string | services | no | An option to override the default filename of the service config |
version | option | number | latest | no | An option to specify which version of the class to use |