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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Eav\Api\Data;
use Magento\Framework\Api\CustomAttributesDataInterface;
use Magento\Framework\Api\MetadataObjectInterface;
/**
* Interface AttributeInterface
* @api
* @since 100.0.2
*/
interface AttributeInterface extends CustomAttributesDataInterface, MetadataObjectInterface
{
const ATTRIBUTE_ID = 'attribute_id';
const IS_UNIQUE = 'is_unique';
const SCOPE = 'scope';
const FRONTEND_CLASS = 'frontend_class';
const ATTRIBUTE_CODE = 'attribute_code';
const FRONTEND_INPUT = 'frontend_input';
const IS_REQUIRED = 'is_required';
const OPTIONS = 'options';
const IS_USER_DEFINED = 'is_user_defined';
const FRONTEND_LABEL = 'frontend_label';
const FRONTEND_LABELS = 'frontend_labels';
const NOTE = 'note';
const BACKEND_TYPE = 'backend_type';
const BACKEND_MODEL = 'backend_model';
const SOURCE_MODEL = 'source_model';
const VALIDATE_RULES = 'validate_rules';
const ENTITY_TYPE_ID = 'entity_type_id';
/**
* Retrieve id of the attribute.
*
* @return int|null
*/
public function getAttributeId();
/**
* Set id of the attribute.
*
* @param int $attributeId
* @return $this
*/
public function setAttributeId($attributeId);
/**
* Retrieve code of the attribute.
*
* @return string
*/
public function getAttributeCode();
/**
* Set code of the attribute.
*
* @param string $attributeCode
* @return $this
*/
public function setAttributeCode($attributeCode);
/**
* Frontend HTML for input element.
*
* @return string
*/
public function getFrontendInput();
/**
* Set frontend HTML for input element.
*
* @param string $frontendInput
* @return $this
*/
public function setFrontendInput($frontendInput);
/**
* Retrieve entity type id
*
* @return string
*/
public function getEntityTypeId();
/**
* Set entity type id
*
* @param string $entityTypeId
* @return $this
*/
public function setEntityTypeId($entityTypeId);
/**
* Whether attribute is required.
*
* @return bool
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getIsRequired();
/**
* Set whether attribute is required.
*
* @param bool $isRequired
* @return $this
*/
public function setIsRequired($isRequired);
/**
* Return options of the attribute (key => value pairs for select)
*
* @return \Magento\Eav\Api\Data\AttributeOptionInterface[]|null
*/
public function getOptions();
/**
* Set options of the attribute (key => value pairs for select)
*
* @param \Magento\Eav\Api\Data\AttributeOptionInterface[] $options
* @return $this
*/
public function setOptions(array $options = null);
/**
* Whether current attribute has been defined by a user.
*
* @return bool|null
*/
public function getIsUserDefined();
/**
* Set whether current attribute has been defined by a user.
*
* @param bool $isUserDefined
* @return $this
*/
public function setIsUserDefined($isUserDefined);
/**
* Return frontend label for default store
*
* @return string|null
*/
public function getDefaultFrontendLabel();
/**
* Set frontend label for default store
*
* @param string $defaultFrontendLabel
* @return $this
*/
public function setDefaultFrontendLabel($defaultFrontendLabel);
/**
* Return frontend label for each store
*
* @return \Magento\Eav\Api\Data\AttributeFrontendLabelInterface[]
*/
public function getFrontendLabels();
/**
* Set frontend label for each store
*
* @param \Magento\Eav\Api\Data\AttributeFrontendLabelInterface[] $frontendLabels
* @return $this
*/
public function setFrontendLabels(array $frontendLabels = null);
/**
* Get the note attribute for the element.
*
* @return string|null
*/
public function getNote();
/**
* Set the note attribute for the element.
*
* @param string $note
* @return $this
*/
public function setNote($note);
/**
* Get backend type.
*
* @return string|null
*/
public function getBackendType();
/**
* Set backend type.
*
* @param string $backendType
* @return $this
*/
public function setBackendType($backendType);
/**
* Get backend model
*
* @return string|null
*/
public function getBackendModel();
/**
* Set backend model
*
* @param string $backendModel
* @return $this
*/
public function setBackendModel($backendModel);
/**
* Get source model
*
* @return string|null
*/
public function getSourceModel();
/**
* Set source model
*
* @param string $sourceModel
* @return $this
*/
public function setSourceModel($sourceModel);
/**
* Get default value for the element.
*
* @return string|null
*/
public function getDefaultValue();
/**
* Set default value for the element.
*
* @param string $defaultValue
* @return $this
*/
public function setDefaultValue($defaultValue);
/**
* Whether this is a unique attribute
*
* @return string|null
*/
public function getIsUnique();
/**
* Set whether this is a unique attribute
*
* @param string $isUnique
* @return $this
*/
public function setIsUnique($isUnique);
/**
* Retrieve frontend class of attribute
*
* @return string|null
*/
public function getFrontendClass();
/**
* Set frontend class of attribute
*
* @param string $frontendClass
* @return $this
*/
public function setFrontendClass($frontendClass);
/**
* Retrieve validation rules.
*
* @return \Magento\Eav\Api\Data\AttributeValidationRuleInterface[]|null
*/
public function getValidationRules();
/**
* Set validation rules.
*
* @param \Magento\Eav\Api\Data\AttributeValidationRuleInterface[] $validationRules
* @return $this
*/
public function setValidationRules(array $validationRules = null);
/**
* @return \Magento\Eav\Api\Data\AttributeExtensionInterface|null
*/
public function getExtensionAttributes();
/**
* Set an extension attributes object
*
* @param \Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes
* @return $this
* @since 102.0.0
*/
public function setExtensionAttributes(
\Magento\Eav\Api\Data\AttributeExtensionInterface $extensionAttributes
);
}