class IHaveRuntimeContexts in Drupal 9
Same name in this branch
- 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php \Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts
- 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php \Drupal\layout_builder_test\Plugin\Block\IHaveRuntimeContexts
Defines a class for a fake context provider.
Hierarchy
- class \Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts implements ContextProviderInterface
Expanded class hierarchy of IHaveRuntimeContexts
1 string reference to 'IHaveRuntimeContexts'
- layout_builder_test.services.yml in core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ layout_builder_test.services.yml - core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.services.yml
1 service uses IHaveRuntimeContexts
- layout_builder_test.i_have_runtime_contexts in core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ layout_builder_test.services.yml - Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts
File
- core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ src/ ContextProvider/ IHaveRuntimeContexts.php, line 12
Namespace
Drupal\layout_builder_test\ContextProviderView source
class IHaveRuntimeContexts implements ContextProviderInterface {
/**
* {@inheritdoc}
*/
public function getRuntimeContexts(array $unqualified_context_ids) {
return [
'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?'), 'for sure you can'),
];
}
/**
* {@inheritdoc}
*/
public function getAvailableContexts() {
return [
'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?')),
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IHaveRuntimeContexts:: |
public | function |
Gets all available contexts for the purposes of configuration. Overrides ContextProviderInterface:: |
|
IHaveRuntimeContexts:: |
public | function |
Gets runtime context values for the given context IDs. Overrides ContextProviderInterface:: |