Heystack\Core\DependencyInjection\SilverStripe\HeystackSilverStripeContainer
Provides a base class for the generated heystack container, to bridge with SilverStripe Injection
This class allows Symfony dependency injection to access services from the SilverStripe
Injection system.
Symfony lowercases all service requests, so a parameter "silverstripe_service_mapping"
can be set that will provide a mapping between "heystack requested" => "SilverStripe provided" services
For example, if there is a service called "Logger" in the SilverStripe injection system,
and it is requested in the Symfony system like so:
services:
my_service:
arguments: [ @silverstripe.logger ]
Then you can allow the service to be accessed via its upper-case name by setting:
parameters:
silverstripe_service_mapping:
logger: Logger
- Author: Cam Spiers <cameron@heyday.co.nz>
- Copyright: Heyday
Synopsis
class HeystackSilverStripeContainer
extends Container
{
- // methods
- public get()
- // Inherited methods from SilverStripeServiceTrait
- public void setInjector()
- protected Injector getInjector()
- protected bool isSilverStripeServiceRequest()
- protected getSilverStripeService()
- public abstract mixed getParameter()
Hierarchy
Extends
- Symfony\Component\DependencyInjection\Container
Uses
Members
protected
- $injector — \Injector
Methods
public
- get() — Use SilverStripe's Dependency Injection system if the service is namespaced silverstripe
Inherited from Heystack\Core\DependencyInjection\SilverStripe\SilverStripeServiceTrait
protected
- getInjector() — Retrieves the Injector instance
- getSilverStripeService()
- isSilverStripeServiceRequest()
public
- getParameter()
- setInjector() — Sets the injector instance