FeaturesBundleInterface.php
7.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<?php
/**
* @file
* Contains \Drupal\features\FeaturesBundleInterface.
*/
namespace Drupal\features;
use Drupal\features\FeaturesManagerInterface;
use Drupal\features\FeaturesAssignerInterface;
use Drupal\features\FeaturesGeneratorInterface;
use Drupal\Core\Extension\Extension;
/**
* Provides an interface for the FeaturesBundle object.
*/
interface FeaturesBundleInterface {
/**
* Determines whether the current bundle is the default one.
*
* @return bool
* Returns TRUE if this is the default bundle.
*/
public function isDefault();
/**
* Returns the machine name of a bundle.
*
* @return string
* The machine name of a bundle.
*
* @see \Drupal\features\FeaturesBundleInterface::setMachineName()
*/
public function getMachineName();
/**
* Sets the machine name of a bundle.
*
* @param string $machine_name
* The machine name of a bundle.
*
* @see \Drupal\features\FeaturesBundleInterface::getMachineName()
*/
public function setMachineName($machine_name);
/**
* Gets the human readable name of a bundle.
*
* @return string
* The human readable name of a bundle.
*
* @see \Drupal\features\FeaturesBundleInterface::setName()
*/
public function getName();
/**
* Sets the human readable name of a bundle.
*
* @param string $name
* The human readable name of a bundle.
*
* @see \Drupal\features\FeaturesBundleInterface::getName()
*/
public function setName($name);
/**
* Returns a full machine name prefixed with the bundle name.
*
* @param string $short_name
* The short machine_name of a bundle.
*
* @return string
* The full machine_name of a bundle.
*/
public function getFullName($short_name);
/**
* Returns a short machine name not prefixed with the bundle name.
*
* @param string $machine_name
* The full machine_name of a bundle.
*
* @return string
* The short machine_name of a bundle.
*/
public function getShortName($machine_name);
/**
* Determines if the $machine_name is prefixed by the bundle machine name.
*
* @param string $machine_name
* The machine name of a package.
*
* @return bool
* TRUE if the machine name is prefixed by the bundle machine name.
*/
public function inBundle($machine_name);
/**
* Determines if the package with $machine_name is the bundle profile.
*
* @param string $machine_name
* The machine name of a package.
*
* @return bool
* TRUE if the machine name is prefixed by the bundle machine name.
*/
public function isProfilePackage($machine_name);
/**
* Gets the description of a bundle.
*
* @return string
* The description of a bundle.
*
* @see \Drupal\features\FeaturesBundleInterface::setDescription()
*/
public function getDescription();
/**
* Sets the description of a bundle.
*
* @param string $description
* The description of a bundle.
*
* @see \Drupal\features\FeaturesBundleInterface::getDescription()
*/
public function setDescription($description);
/**
* Gets option for using a profile with this bundle.
*
* @return bool
* TRUE if a profile is used with this profile.
*/
public function isProfile();
/**
* Sets option for using a profile with this bundle.
*
* @param bool $value
* TRUE if a profile is used with this profile.
*/
public function setIsProfile($value);
/**
* Returns the machine name of the profile.
*
* If the bundle doesn't use a profile, return the current site profile.
*
* @return string
* THe machie name of a profile.
*
* @see \Drupal\features\FeaturesBundleInterface::setProfileName()
*/
public function getProfileName();
/**
* Sets the name of the profile associated with this bundle.
*
* @param string $machine_name
* The machine name of a profile.
*
* @see \Drupal\features\FeaturesBundleInterface::getProfileName()
*/
public function setProfileName($machine_name);
/**
* Gets the list of enabled assignment methods.
*
* @return array
* An array of method IDs keyed by assignment method IDs.
*
* @see \Drupal\features\FeaturesBundleInterface::setEnabledAssignments()
*/
public function getEnabledAssignments();
/**
* Sets the list of enabled assignment methods.
*
* @param array $assignments
* An array of values keyed by assignment method IDs. Non-empty value is
* enabled.
*
* @see \Drupal\features\FeaturesBundleInterface::getEnabledAssignments()
*/
public function setEnabledAssignments(array $assignments);
/**
* Gets the weights of the assignment methods.
*
* @return array
* An array keyed by assignment method_id with a numeric weight.
*
* @see \Drupal\features\FeaturesBundleInterface::setAssignmentWeights()
*/
public function getAssignmentWeights();
/**
* Sets the weights of the assignment methods.
*
* @param array $assignments
* An array keyed by assignment method_id with a numeric weight value.
*
* @see \Drupal\features\FeaturesBundleInterface::getAssignmentWeights()
*/
public function setAssignmentWeights(array $assignments);
/**
* Gets settings specific to an assignment method.
*
* @param string $method_id
* The ID of an assignment method. If NULL, return all assignment settings
* keyed by method_id.
*
* @return array
* An array of settings. Format specific to assignment method.
*
* @see \Drupal\features\FeaturesBundleInterface::setAssignmentSettings()
*/
public function getAssignmentSettings($method_id);
/**
* Sets settings specific to an assignment method.
*
* @param string $method_id
* The ID of an assignment method. If NULL, all $settings are given keyed
* by method_ID.
* @param array $settings
* An array of setting values.
*
* @see \Drupal\features\FeaturesBundleInterface::getAssignmentSettings()
*/
public function setAssignmentSettings($method_id, array $settings);
/**
* Gets global settings for a bundle.
*
* @return array
* An array with the following keys:
* - folder: subfolder to export modules within this package set.
* - profile: boolean to determine if set is a profile.
*
* @see \Drupal\features\FeaturesBundleInterface::setSettings()
*/
public function getSettings();
/**
* Sets the global settings for a bundle.
*
* @param array $settings
* An array of setting values.
*
* @see \Drupal\features\FeaturesBundleInterface::getSettings()
*/
public function setSettings(array $settings);
/**
* Loads a named bundle from the active config.
*
* @param string $machine_name
* The machine name of a bundle. If omitted, use the current machine_name,
* otherwise replace the data in the bundle with the data from the config.
*/
public function load($machine_name = NULL);
/**
* Saves the bundle to the active config.
*/
public function save();
/**
* Removes the bundle from the active config.
*/
public function remove();
}