Skip to content

Commit 000a448

Browse files
authored
MDEE-359: Retrieve category permissions from Magento (#216)
* MDEE-359: Retrieve category permissions from Magento
1 parent 495b1e8 commit 000a448

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

DataExporter/Config/Converter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function convert($source)
4949
foreach ($configData['config'][0]['record'] as $queryData) {
5050
$records[$queryData['name']] = [
5151
'name' => $queryData['name'],
52+
'skipNull' => isset($queryData['skipNull']) && $queryData['skipNull'] == "true"
5253
];
5354
$idField = null;
5455
foreach ($queryData['field'] as $fieldData) {

DataExporter/Export/Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function castToFieldType(array $rootField, $value)
147147
foreach ($type['field'] as $field) {
148148
if (isset($value[$field['name']])) {
149149
$result[$field['name']] = $this->castToFieldType($field, $value[$field['name']]);
150-
} else {
150+
} elseif (!$type['skipNull']) {
151151
$result[$field['name']] = null;
152152
}
153153
}

DataExporter/Model/Indexer/FeedIndexMetadata.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function getSourceTableIdentityField(): string
149149
}
150150

151151
/**
152-
* Get feed identity
152+
* Feed identity. Used as argument name in Data Provider that holds ids from Source Table
153153
*
154154
* @return string
155155
*/
@@ -169,7 +169,7 @@ public function getFeedTableName(): string
169169
}
170170

171171
/**
172-
* Get feed table field
172+
* Feed Table Field - part of the feed identity, used to find all feed items and mark entity as "deleted"
173173
*
174174
* @return string
175175
*/

DataExporter/etc/et_schema.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
<xs:element name="field" type="Field"/>
3939
</xs:choice>
4040
<xs:attribute name="name" type="xs:string" use="required" />
41+
<!-- With skipNull=true fields with null values will be omitted from payload for REST API -->
42+
<xs:attribute name="skipNull" type="xs:boolean" use="optional" default="false" />
4143
</xs:complexType>
4244
<xs:complexType name="Field">
4345
<xs:choice minOccurs="0" maxOccurs="unbounded">

0 commit comments

Comments
 (0)