5865e995e8fc2b89e665411395bf58f5fef164e3
[yaffs-website] / Plugin / VariantCollectionInterface.php
1 <?php
2
3 namespace Drupal\ctools\Plugin;
4
5 /**
6  * Provides an interface for objects that have variants e.g. Pages.
7  */
8 interface VariantCollectionInterface {
9
10   /**
11    * Adds a new variant to the entity.
12    *
13    * @param array $configuration
14    *   An array of configuration for the new variant.
15    *
16    * @return string
17    *   The variant ID.
18    */
19   public function addVariant(array $configuration);
20
21   /**
22    * Retrieves a specific variant.
23    *
24    * @param string $variant_id
25    *   The variant ID.
26    *
27    * @return \Drupal\Core\Display\VariantInterface
28    *   The variant object.
29    */
30   public function getVariant($variant_id);
31
32   /**
33    * Removes a specific variant.
34    *
35    * @param string $variant_id
36    *   The variant ID.
37    *
38    * @return $this
39    */
40   public function removeVariant($variant_id);
41
42   /**
43    * Returns the variants available for the entity.
44    *
45    * @return \Drupal\Core\Display\VariantInterface[]
46    *   An array of the variants.
47    */
48   public function getVariants();
49
50 }