interface VariantInterface in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Display/VariantInterface.php \Drupal\Core\Display\VariantInterface
Provides an interface for DisplayVariant plugins.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurablePluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
- interface \Drupal\Core\Display\VariantInterface
Expanded class hierarchy of VariantInterface
All classes that implement VariantInterface
See also
\Drupal\Core\Display\Annotation\DisplayVariant
\Drupal\Core\Display\VariantBase
\Drupal\Core\Display\VariantManager
File
- core/
lib/ Drupal/ Core/ Display/ VariantInterface.php, line 24 - Contains \Drupal\Core\Display\VariantInterface.
Namespace
Drupal\Core\DisplayView source
interface VariantInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface, RefinableCacheableDependencyInterface {
/**
* Returns the user-facing display variant label.
*
* @return string
* The display variant label.
*/
public function label();
/**
* Returns the admin-facing display variant label.
*
* This is for the type of display variant, not the configured variant itself.
*
* @return string
* The display variant administrative label.
*/
public function adminLabel();
/**
* Returns the unique ID for the display variant.
*
* @return string
* The display variant ID.
*/
public function id();
/**
* Returns the weight of the display variant.
*
* @return int
* The display variant weight.
*/
public function getWeight();
/**
* Sets the weight of the display variant.
*
* @param int $weight
* The weight to set.
*/
public function setWeight($weight);
/**
* Determines if this display variant is accessible.
*
* @param \Drupal\Core\Session\AccountInterface $account
* (optional) The user for which to check access, or NULL to check access
* for the current user. Defaults to NULL.
*
* @return bool
* TRUE if this display variant is accessible, FALSE otherwise.
*/
public function access(AccountInterface $account = NULL);
/**
* Builds and returns the renderable array for the display variant.
*
* The variant can contain cacheability metadata for the configuration that
* was passed in setConfiguration(). In the build() method, this should be
* added to the render array that is returned.
*
* @return array
* A render array for the display variant.
*/
public function build();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyInterface:: |
public | function | The cache contexts associated with this object. | 26 |
CacheableDependencyInterface:: |
public | function | The maximum age for which this object may be cached. | 26 |
CacheableDependencyInterface:: |
public | function | The cache tags associated with this object. | 19 |
ConfigurablePluginInterface:: |
public | function | Gets default configuration for this plugin. | 9 |
ConfigurablePluginInterface:: |
public | function | Gets this plugin's configuration. | 10 |
ConfigurablePluginInterface:: |
public | function | Sets the configuration for this plugin instance. | 10 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 15 |
PluginFormInterface:: |
public | function | Form constructor. | 23 |
PluginFormInterface:: |
public | function | Form submission handler. | 21 |
PluginFormInterface:: |
public | function | Form validation handler. | 12 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 2 |
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 |