ExtensionController
class ExtensionController extends AbstractController (View source)
Traits
Properties
protected EntityManagerInterface | $entityManager | from ServicesTrait | |
protected ContainerInterface | $container | from ServicesTrait | |
protected Query | $query | from ServicesTrait | |
protected Config | $boltConfig | from ServicesTrait |
Methods
Injects commonly used objects into the extension, for use by the extension. Called from the listener.
This bit of code allows us to get services from the container, even if they are not marked public. We need to be able to do this, because we can't anticipate which services an extension's author will want to get, and neither should we want to make them all public. So, we resort to this, regardless of them being private / public. With great power comes great responsibility.
Details
void
injectObjects(array $objects)
Injects commonly used objects into the extension, for use by the extension. Called from the listener.
getService(string $name)
This bit of code allows us to get services from the container, even if they are not marked public. We need to be able to do this, because we can't anticipate which services an extension's author will want to get, and neither should we want to make them all public. So, we resort to this, regardless of them being private / public. With great power comes great responsibility.
Note: We wouldn't have to do this, if we could Autowire services in our own code. If you have good ideas on how to accomplish that, we'd be happy to hear from your ideas.
Collection
getAllServiceNames()
Widgets|null
getWidgets()
Config
getBoltConfig()
Environment
getTwig()
Session
getSession()
EventDispatcherInterface
getEventDispatcher()
EntityManagerInterface
getObjectManager()
Stopwatch
getStopwatch()
LoggerInterface
getLogger()
ContainerInterface
getContainer()
Query
getQuery()
Request
getRequest()
string
getClass()
Returns the classname of the Extension