Version 1
[yaffs-website] / web / modules / contrib / linkit / src / AttributeInterface.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\linkit\AttributeInterface.
6  */
7
8 namespace Drupal\linkit;
9
10 use Drupal\Component\Plugin\ConfigurablePluginInterface;
11 use Drupal\Component\Plugin\PluginInspectionInterface;
12
13 /**
14  * Defines the interface for attributes plugins.
15  *
16  * @see \Drupal\linkit\Annotation\Attribute
17  * @see \Drupal\linkit\AttributeBase
18  * @see \Drupal\linkit\AttributeManager
19  * @see plugin_api
20  */
21 interface AttributeInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
22
23   /**
24    * Returns the attribute label.
25    *
26    * @return string
27    *   The attribute label.
28    */
29   public function getLabel();
30
31   /**
32    * Returns the attribute description.
33    *
34    * @return string
35    *   The attribute description.
36    */
37   public function getDescription();
38
39   /**
40    * Returns the attribute html name. This is the name of the attribute
41    * that will be inserted in the <code>&lt;a&gt;</code> tag.
42    *
43    * @return string
44    *   The attribute html name.
45    */
46   public function getHtmlName();
47
48   /**
49    * Returns the weight of the attribute.
50    *
51    * @return int|string
52    *   Either the integer weight of the attribute or an empty string.
53    */
54   public function getWeight();
55
56   /**
57    * Sets the weight for this attribute.
58    *
59    * @param int $weight
60    *   The weight for this attribute.
61    *
62    * @return $this
63    */
64   public function setWeight($weight);
65
66   /**
67    * The form element structure for this attribute to be used in the dialog.
68    *
69    * @param mixed $default_value
70    *   The default value for the element. Used when editing an attribute in the
71    *   dialog.
72    *
73    * @return array
74    *   The form element.
75    */
76   public function buildFormElement($default_value);
77
78 }