Passed
Push — feature/eco-3656/eco-3658-enab... ( b8179e...c68c7e )
by
unknown
05:37
created

mapPaymentComputopOrderItemEntityCollectionToComputopPaymentComputopOrderItemTransferCollection()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 14
rs 10
cc 2
nc 2
nop 2
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Computop\Persistence\Propel\Mapper;
9
10
use Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rItemCollectionTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...mputopOrderItemTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Generated\Shared\Transfer\ComputopPaymentComputopTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PaymentComputopTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rItemCollectionTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Generated\Shared\Transfer\ComputopSalesOrderItemTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...pSalesOrderItemTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Orm\Zed\Computop\Persistence\SpyPaymentComputop;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Computop\Persistence\SpyPaymentComputop was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Computop\Persist...aymentComputopOrderItem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use Orm\Zed\Sales\Persistence\SpySalesOrderItem;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Sales\Persistence\SpySalesOrderItem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use Propel\Runtime\Collection\Collection;
19
20
class ComputopMapper
21
{
22
    /**
23
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputop $computopPaymentEntity
24
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentTransfer
25
     *
26
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopTransfer
27
     */
28
    public function mapComputopPaymentEntityToComputopPaymentTransfer(
29
        SpyPaymentComputop $computopPaymentEntity,
30
        ComputopPaymentComputopTransfer $computopPaymentTransfer
31
    ): ComputopPaymentComputopTransfer {
32
        $computopPaymentTransfer->fromArray($computopPaymentEntity->toArray(), true);
33
34
        return $computopPaymentTransfer;
35
    }
36
37
    /**
38
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentTransfer
39
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputop $computopPaymentEntity
40
     *
41
     * @return \Orm\Zed\Computop\Persistence\SpyPaymentComputop
42
     */
43
    public function mapComputopPaymentTransferToComputopPaymentEntity(
44
        ComputopPaymentComputopTransfer $computopPaymentTransfer,
45
        SpyPaymentComputop $computopPaymentEntity
46
    ): SpyPaymentComputop {
47
        $computopPaymentEntity->fromArray($computopPaymentTransfer->toArray());
48
49
        return $computopPaymentEntity;
50
    }
51
52
    /**
53
     * @param \Propel\Runtime\Collection\Collection $salesOrderItemsCollection
54
     * @param \Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer
55
     *
56
     * @return \Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer
57
     */
58
    public function mapSalesOrderItemsCollectionToComputopSalesOrderItemCollectionTransfer(
59
        Collection $salesOrderItemsCollection,
60
        ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer
61
    ): ComputopSalesOrderItemCollectionTransfer {
62
        foreach ($salesOrderItemsCollection as $salesOrderItem) {
63
            $computopSalesOrderItemTransfer = $this->
64
            mapSalesOrderItemToComputopSalesOrderItemTransfer($salesOrderItem, new ComputopSalesOrderItemTransfer());
65
            $computopSalesOrderItemCollectionTransfer->addComputopSalesOrderItem($computopSalesOrderItemTransfer);
66
        }
67
68
        return $computopSalesOrderItemCollectionTransfer;
69
    }
70
71
    /**
72
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $salesOrderItem
73
     * @param \Generated\Shared\Transfer\ComputopSalesOrderItemTransfer $computopSalesOrderItemTransfer
74
     *
75
     * @return \Generated\Shared\Transfer\ComputopSalesOrderItemTransfer
76
     */
77
    public function mapSalesOrderItemToComputopSalesOrderItemTransfer(
78
        SpySalesOrderItem $salesOrderItem,
79
        ComputopSalesOrderItemTransfer $computopSalesOrderItemTransfer
80
    ): ComputopSalesOrderItemTransfer {
81
        $computopSalesOrderItemTransfer->fromArray($salesOrderItem->toArray(), true);
82
83
        return $computopSalesOrderItemTransfer;
84
    }
85
86
    /**
87
     * @param \Propel\Runtime\Collection\Collection $paymentComputopOrderItemsCollection
88
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer $computopPaymentComputopOrderItemCollectionTransfer
89
     *
90
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer
91
     */
92
    public function mapPaymentComputopOrderItemEntityCollectionToComputopPaymentComputopOrderItemTransferCollection(
93
        Collection $paymentComputopOrderItemsCollection,
94
        ComputopPaymentComputopOrderItemCollectionTransfer $computopPaymentComputopOrderItemCollectionTransfer
95
    ): ComputopPaymentComputopOrderItemCollectionTransfer {
96
        foreach ($paymentComputopOrderItemsCollection as $paymentComputopOrderItem) {
97
            $computopPaymentOrderItemTransfer = $this->
98
            mapPaymentComputopOrderItemEntityToComputopPaymentComputopOrderItemTransfer(
99
                $paymentComputopOrderItem,
100
                new ComputopPaymentComputopOrderItemTransfer()
101
            );
102
            $computopPaymentComputopOrderItemCollectionTransfer->addComputopPaymentComputopOrderItem($computopPaymentOrderItemTransfer);
103
        }
104
105
        return $computopPaymentComputopOrderItemCollectionTransfer;
106
    }
107
108
    /**
109
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem
110
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer
111
     *
112
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer
113
     */
114
    public function mapPaymentComputopOrderItemEntityToComputopPaymentComputopOrderItemTransfer(
115
        SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem,
116
        ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer
117
    ): ComputopPaymentComputopOrderItemTransfer {
118
        $computopPaymentComputopOrderItemTransfer->fromArray($spyPaymentComputopOrderItem->toArray(), true);
119
120
        return $computopPaymentComputopOrderItemTransfer;
121
    }
122
123
    /**
124
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer
125
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem
126
     *
127
     * @return \Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem
128
     */
129
    public function mapComputopPaymentComputopOrderItemTransferToPaymentComputopOrderItemEntity(
130
        ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer,
131
        SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem
132
    ): SpyPaymentComputopOrderItem {
133
        $spyPaymentComputopOrderItem->fromArray($computopPaymentComputopOrderItemTransfer->toArray());
134
135
        return $spyPaymentComputopOrderItem;
136
    }
137
}
138