| @@ 1641-1656 (lines=16) @@ | ||
| 1638 | if ($productStreamService->allowToRemove($assignments, $streamId, $item['articleId'])) { |
|
| 1639 | $this->getSDK()->recordDelete($item['sourceId']); |
|
| 1640 | $removedRecords[] = $item['sourceId']; |
|
| 1641 | } else { |
|
| 1642 | //updates items with the new streams |
|
| 1643 | $streamCollection = $assignments->getStreamsByArticleId($item['articleId']); |
|
| 1644 | if (!$this->getHelper()->isMainVariant($item['sourceId']) || !$streamCollection) { |
|
| 1645 | continue; |
|
| 1646 | } |
|
| 1647 | ||
| 1648 | //removes current stream from the collection |
|
| 1649 | unset($streamCollection[$streamId]); |
|
| 1650 | ||
| 1651 | $this->getSDK()->recordStreamAssignment( |
|
| 1652 | $item['sourceId'], |
|
| 1653 | $streamCollection, |
|
| 1654 | $item['groupId'] |
|
| 1655 | ); |
|
| 1656 | } |
|
| 1657 | } |
|
| 1658 | ||
| 1659 | $connectExport->updateConnectItemsStatus($removedRecords, Attribute::STATUS_DELETE); |
|
| @@ 227-242 (lines=16) @@ | ||
| 224 | if ($productStreamService->allowToRemove($assignments, $streamId, $item['articleId'])) { |
|
| 225 | $this->sdk->recordDelete($item['sourceId']); |
|
| 226 | $removedRecords[] = $item['sourceId']; |
|
| 227 | } else { |
|
| 228 | //updates items with the new streams |
|
| 229 | $streamCollection = $assignments->getStreamsByArticleId($item['articleId']); |
|
| 230 | if (!$this->helper->isMainVariant($item['sourceId']) || !$streamCollection) { |
|
| 231 | continue; |
|
| 232 | } |
|
| 233 | ||
| 234 | //removes current stream from the collection |
|
| 235 | unset($streamCollection[$streamId]); |
|
| 236 | ||
| 237 | $this->sdk->recordStreamAssignment( |
|
| 238 | $item['sourceId'], |
|
| 239 | $streamCollection, |
|
| 240 | $item['groupId'] |
|
| 241 | ); |
|
| 242 | } |
|
| 243 | } |
|
| 244 | ||
| 245 | $this->connectExport->updateConnectItemsStatus($removedRecords, Attribute::STATUS_DELETE); |
|