ContextProviderInterface
interface ContextProviderInterface (View source)
Defines an interface for providing plugin contexts.
Implementations only need to deal with unqualified context IDs so they only need to be unique in the context of a given service provider.
The fully qualified context ID then includes the service ID, e.g. "@service_id:unqualified_context_id".
Methods
Gets runtime context values for the given context IDs.
Gets all available contexts for the purposes of configuration.
Details
ContextInterface[]
getRuntimeContexts(array $unqualified_context_ids)
Gets runtime context values for the given context IDs.
For context-aware plugins to function correctly, all of the contexts that they require must be populated with values. So this method should set a value for each context that it adds. For example:
ContextInterface[]
getAvailableContexts()
Gets all available contexts for the purposes of configuration.
When a context aware plugin is being configured, the configuration UI must know which named contexts are potentially available, but does not care about the value, since the value can be different for each request, and might not be available at all during the configuration UI's request.
For example: