interface BlockVariantInterface in Chaos Tool Suite (ctools) 8.3
Provides an interface for variant plugins that use block plugins.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Component\Plugin\ConfigurablePluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
- interface \Drupal\Core\Display\VariantInterface
- interface \Drupal\ctools\Plugin\BlockVariantInterface
- interface \Drupal\Core\Display\VariantInterface
Expanded class hierarchy of BlockVariantInterface
All classes that implement BlockVariantInterface
2 files declare their use of BlockVariantInterface
- BlockDisplayVariant.php in src/
Plugin/ DisplayVariant/ BlockDisplayVariant.php - BlockVariantEvent.php in src/
Event/ BlockVariantEvent.php
File
- src/
Plugin/ BlockVariantInterface.php, line 10
Namespace
Drupal\ctools\PluginView source
interface BlockVariantInterface extends VariantInterface {
/**
* Returns the human-readable list of regions keyed by machine name.
*
* @return array
* An array of human-readable region names keyed by machine name.
*/
public function getRegionNames();
/**
* Returns the human-readable name of a specific region.
*
* @param string $region
* The machine name of a region.
*
* @return string
* The human-readable name of a region.
*/
public function getRegionName($region);
/**
* Adds a block to this display variant.
*
* @param array $configuration
* An array of block configuration.
*
* @return string
* The block ID.
*/
public function addBlock(array $configuration);
/**
* Returns the region a specific block is assigned to.
*
* @param string $block_id
* The block ID.
*
* @return string
* The machine name of the region this block is assigned to.
*/
public function getRegionAssignment($block_id);
/**
* Returns an array of regions and their block plugins.
*
* @return array
* The array is first keyed by region machine name, with the values
* containing an array keyed by block ID, with block plugin instances as the
* values.
*/
public function getRegionAssignments();
/**
* Returns a specific block plugin.
*
* @param string $block_id
* The block ID.
*
* @return \Drupal\Core\Block\BlockPluginInterface
* The block plugin.
*/
public function getBlock($block_id);
/**
* Updates the configuration of a specific block plugin.
*
* @param string $block_id
* The block ID.
* @param array $configuration
* The array of configuration to set.
*
* @return $this
*/
public function updateBlock($block_id, array $configuration);
/**
* Removes a specific block from this display variant.
*
* @param string $block_id
* The block ID.
*
* @return $this
*/
public function removeBlock($block_id);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockVariantInterface:: |
public | function | Adds a block to this display variant. | |
BlockVariantInterface:: |
public | function | Returns a specific block plugin. | |
BlockVariantInterface:: |
public | function | Returns the region a specific block is assigned to. | |
BlockVariantInterface:: |
public | function | Returns an array of regions and their block plugins. | |
BlockVariantInterface:: |
public | function | Returns the human-readable name of a specific region. | |
BlockVariantInterface:: |
public | function | Returns the human-readable list of regions keyed by machine name. | |
BlockVariantInterface:: |
public | function | Removes a specific block from this display variant. | |
BlockVariantInterface:: |
public | function | Updates the configuration of a specific block plugin. | |
CacheableDependencyInterface:: |
public | function | The cache contexts associated with this object. | 34 |
CacheableDependencyInterface:: |
public | function | The maximum age for which this object may be cached. | 34 |
CacheableDependencyInterface:: |
public | function | The cache tags associated with this object. | 27 |
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
RefinableCacheableDependencyInterface:: |
public | function | Adds a dependency on an object: merges its cacheability metadata. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache contexts. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache tags. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Merges the maximum age (in seconds) with the existing maximum age. | 1 |
VariantInterface:: |
public | function | Determines if this display variant is accessible. | 1 |
VariantInterface:: |
public | function | Returns the admin-facing display variant label. | 1 |
VariantInterface:: |
public | function | Builds and returns the renderable array for the display variant. | 3 |
VariantInterface:: |
public | function | Returns the weight of the display variant. | 1 |
VariantInterface:: |
public | function | Returns the unique ID for the display variant. | 1 |
VariantInterface:: |
public | function | Returns the user-facing display variant label. | 1 |
VariantInterface:: |
public | function | Sets the weight of the display variant. | 1 |