Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit f8c9e15

Browse files
dineshvbkeharper
andauthored
issue-2916-rebased to master branch (#8218)
Co-authored-by: Kevin Harper <[email protected]>
1 parent 82dd2b0 commit f8c9e15

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/guides/v2.3/extension-dev-guide/extension_attributes/adding-attributes.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ Now we need to bind our plugin to `ProductInterface`:
175175

176176
## Extension Attributes Configuration:
177177

178-
For scalar attributes we can use next configuration:
178+
The file that holds these extension attributes must reside under the `/etc` folder of your module.
179+
180+
For scalar attributes, we can use the following configuration:
179181

180182
```xml
181183
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
@@ -186,6 +188,8 @@ For scalar attributes we can use next configuration:
186188
</config>
187189
```
188190

191+
Here, the scalar attributes indicate the simple form of attribute representation, such as an integer or a string. Specify the class or interface of the extension attributes inside the "for" attribute of the `<extension_attributes>` tag. In this case, it is the ProductInterface. The attribute is specified with a unique code and its type.
192+
189193
For non-scalar attributes:
190194

191195
```xml
@@ -196,6 +200,8 @@ For non-scalar attributes:
196200
</config>
197201
```
198202

203+
Here, the non-scalar attributes indicate data objects such as the instance of a class. In the above example, the CustomDataInterface object is added as an extension attribute.
204+
199205
For array extension attributes:
200206

201207
```xml
@@ -206,6 +212,8 @@ For array extension attributes:
206212
</config>
207213
```
208214

215+
The array extension attributes are just an extension of the scalar attributes where a range of values can be represented as an attribute. The `[]` symbol indicates the attribute type is an array.
216+
209217
The array indicator `[]` can also be appended to non-scalar types.
210218

211219
In first - scalar - case we will get the next result:

0 commit comments

Comments
 (0)