This repository has been archived on 2025-01-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/web/modules/contrib/ctools/src/Plugin/VariantCollectionInterface.php
2017-05-22 15:12:47 +01:00

50 lines
999 B
PHP

<?php
namespace Drupal\ctools\Plugin;
/**
* Provides an interface for objects that have variants e.g. Pages.
*/
interface VariantCollectionInterface {
/**
* Adds a new variant to the entity.
*
* @param array $configuration
* An array of configuration for the new variant.
*
* @return string
* The variant ID.
*/
public function addVariant(array $configuration);
/**
* Retrieves a specific variant.
*
* @param string $variant_id
* The variant ID.
*
* @return \Drupal\Core\Display\VariantInterface
* The variant object.
*/
public function getVariant($variant_id);
/**
* Removes a specific variant.
*
* @param string $variant_id
* The variant ID.
*
* @return $this
*/
public function removeVariant($variant_id);
/**
* Returns the variants available for the entity.
*
* @return \Drupal\Core\Display\VariantInterface[]
* An array of the variants.
*/
public function getVariants();
}