You are here

public static function ContextDefinition::create in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php \Drupal\Core\Plugin\Context\ContextDefinition::create()

Creates a new context definition.

Parameters

string $data_type: The data type for which to create the context definition. Defaults to 'any'.

Return value

static The created context definition object.

3 calls to ContextDefinition::create()
ContextAwarePluginBaseTest::setUp in core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php
LayoutBuilderEntityViewDisplay::getContextsForEntity in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Gets the available contexts for a given entity.
OverridesSectionStorageTest::testGetDefaultSectionStorage in core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php
@covers ::getDefaultSectionStorage

File

core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php, line 114

Class

ContextDefinition
Defines a class for context definitions.

Namespace

Drupal\Core\Plugin\Context

Code

public static function create($data_type = 'any') {
  return new static($data_type);
}