class IHaveRuntimeContexts

Same name in this branch
  1. 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php \Drupal\layout_builder_test\Plugin\Block\IHaveRuntimeContexts
Same name in other branches
  1. 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php \Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts
  2. 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php \Drupal\layout_builder_test\Plugin\Block\IHaveRuntimeContexts
  3. 11.x core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php \Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts
  4. 11.x 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

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\ContextProvider
View 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

Title Sort descending Modifiers Object type Summary Overriden Title
IHaveRuntimeContexts::getAvailableContexts public function Gets all available contexts for the purposes of configuration. Overrides ContextProviderInterface::getAvailableContexts
IHaveRuntimeContexts::getRuntimeContexts public function Gets runtime context values for the given context IDs. Overrides ContextProviderInterface::getRuntimeContexts

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.