Delete::exportContextData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace GFG\DTOMarketplace\Context\Venture\Product;
4
5
class Delete extends Update
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function exportContextData()
11
    {
12
        $dataWrapper      = $this->getDataWrapper();
13
        $simpleCollection = [];
14
15
        foreach ($dataWrapper->getSimpleCollection() as $simple) {
16
            $simpleCollection[] = [
17
                'sku'    => $simple->getSku(),
18
                'status' => $simple->getStatus()
19
            ];
20
        }
21
22
        return $this->prepareExport([
23
            'sku'               => $dataWrapper->getSku(),
24
            'status'            => $dataWrapper->getStatus(),
25
            'simple_collection' => $simpleCollection
26
        ]);
27
    }
28
}
29