Version 1
[yaffs-website] / web / modules / contrib / linkit / src / ProfileInterface.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\linkit\ProfileInterface.
6  */
7
8 namespace Drupal\linkit;
9
10 use Drupal\Core\Config\Entity\ConfigEntityInterface;
11
12 /**
13  * Provides an interface defining a profile entity.
14  */
15 interface ProfileInterface extends ConfigEntityInterface {
16
17   /**
18    * Gets the profile description.
19    *
20    * @return string
21    *   The profile description.
22    */
23   public function getDescription();
24
25   /**
26    * Sets the profile description.
27    *
28    * @param string $description
29    *   The profile description.
30    *
31    * @return $this
32    */
33   public function setDescription($description);
34
35   /**
36    * Returns a specific attribute.
37    *
38    * @param string $attribute_id
39    *   The attribute ID.
40    *
41    * @return \Drupal\linkit\AttributeInterface
42    *   The attribute object.
43    */
44   public function getAttribute($attribute_id);
45
46   /**
47    * Returns the attributes for this profile.
48    *
49    * @return \Drupal\linkit\AttributeCollection|\Drupal\linkit\AttributeInterface[]
50    *   The attribute collection.
51    */
52   public function getAttributes();
53
54   /**
55    * Adds an attribute to this profile.
56    *
57    * @param array $configuration
58    *   An array of attribute configuration.
59    *
60    * @return String
61    *   The ID of the attribute.
62    */
63   public function addAttribute(array $configuration);
64
65   /**
66    * Removes an attribute from this profile.
67    *
68    * @param string $attribute_id
69    *  The attribute ID.
70    *
71    * @return $this
72    */
73   public function removeAttribute($attribute_id);
74
75   /**
76    * Sets the configuration for an attribute instance.
77    *
78    * @param string $attribute_id
79    *   The ID of the attribute to set the configuration for.
80    * @param array $configuration
81    *   The attribute configuration to set.
82    *
83    * @return $this
84    */
85   public function setAttributeConfig($attribute_id, array $configuration);
86
87   /**
88    * Returns a specific matcher.
89    *
90    * @param string $instance_id
91    *   The matcher instance ID.
92    *
93    * @return \Drupal\linkit\MatcherInterface
94    *   The matcher object.
95    */
96   public function getMatcher($instance_id);
97
98   /**
99    * Returns the matchers for this profile.
100    *
101    * @return \Drupal\linkit\MatcherCollection|\Drupal\linkit\MatcherInterface[]
102    *   The matcher collection.
103    */
104   public function getMatchers();
105
106   /**
107    * Adds a matcher to this profile.
108    *
109    * @param array $configuration
110    *   An array of matcher configuration.
111    *
112    * @return string
113    *   The instance ID of the matcher.
114    */
115   public function addMatcher(array $configuration);
116
117   /**
118    * Removes a matcher from this profile.
119    *
120    * @param \Drupal\linkit\MatcherInterface $matcher
121    *  The matcher object.
122    *
123    * @return $this
124    */
125   public function removeMatcher(MatcherInterface $matcher);
126
127   /**
128    * Sets the configuration for a matcher instance.
129    *
130    * @param string $instance_id
131    *   The instance ID of the matcher to set the configuration for.
132    * @param array $configuration
133    *   The matcher configuration to set.
134    *
135    * @return $this
136    */
137   public function setMatcherConfig($instance_id, array $configuration);
138
139 }