Passed
Push — feature/eco-3623-payone-pay-u-... ( 0352c0...9195a2 )
by Roman
03:37
created

mapPaymentComputopOrderItemEntityCollectionToComputopPaymentComputopOrderItemTransferCollection()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
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\ComputopPaymentComputopDetailTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tComputopDetailTransfer 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\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...
12
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...
13
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...
14
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...
15
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...
16
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...
17
use Orm\Zed\Computop\Persistence\SpyPaymentComputopDetail;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Computop\Persist...pyPaymentComputopDetail 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 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...
19
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...
20
use Propel\Runtime\Collection\ObjectCollection;
21
22
class ComputopMapper
23
{
24
    /**
25
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputop $computopPaymentEntity
26
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentTransfer
27
     *
28
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopTransfer
29
     */
30
    public function mapComputopPaymentEntityToComputopPaymentTransfer(
31
        SpyPaymentComputop $computopPaymentEntity,
32
        ComputopPaymentComputopTransfer $computopPaymentTransfer
33
    ): ComputopPaymentComputopTransfer {
34
        $computopPaymentTransfer->fromArray($computopPaymentEntity->toArray(), true);
35
        $computopPaymentTransfer->setFKSalesOrder($computopPaymentEntity->getFkSalesOrder());
36
37
        return $computopPaymentTransfer;
38
    }
39
40
    /**
41
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentTransfer
42
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputop $computopPaymentEntity
43
     *
44
     * @return \Orm\Zed\Computop\Persistence\SpyPaymentComputop
45
     */
46
    public function mapComputopPaymentTransferToComputopPaymentEntity(
47
        ComputopPaymentComputopTransfer $computopPaymentTransfer,
48
        SpyPaymentComputop $computopPaymentEntity
49
    ): SpyPaymentComputop {
50
        $computopPaymentEntity->fromArray($computopPaymentTransfer->modifiedToArray());
51
52
        return $computopPaymentEntity;
53
    }
54
55
    /**
56
     * @param \Propel\Runtime\Collection\ObjectCollection $salesOrderItemEntityCollection
57
     * @param \Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer
58
     *
59
     * @return \Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer
60
     */
61
    public function mapSalesOrderItemEntityCollectionToComputopSalesOrderItemCollectionTransfer(
62
        ObjectCollection $salesOrderItemEntityCollection,
63
        ComputopSalesOrderItemCollectionTransfer $computopSalesOrderItemCollectionTransfer
64
    ): ComputopSalesOrderItemCollectionTransfer {
65
        foreach ($salesOrderItemEntityCollection as $salesOrderItemEntity) {
66
            $computopSalesOrderItemTransfer = $this
67
                ->mapSalesOrderItemToComputopSalesOrderItemTransfer($salesOrderItemEntity, new ComputopSalesOrderItemTransfer());
68
            $computopSalesOrderItemCollectionTransfer->addComputopSalesOrderItem($computopSalesOrderItemTransfer);
69
        }
70
71
        return $computopSalesOrderItemCollectionTransfer;
72
    }
73
74
    /**
75
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $salesOrderItem
76
     * @param \Generated\Shared\Transfer\ComputopSalesOrderItemTransfer $computopSalesOrderItemTransfer
77
     *
78
     * @return \Generated\Shared\Transfer\ComputopSalesOrderItemTransfer
79
     */
80
    public function mapSalesOrderItemToComputopSalesOrderItemTransfer(
81
        SpySalesOrderItem $salesOrderItem,
82
        ComputopSalesOrderItemTransfer $computopSalesOrderItemTransfer
83
    ): ComputopSalesOrderItemTransfer {
84
        $computopSalesOrderItemTransfer->fromArray($salesOrderItem->toArray(), true);
85
86
        return $computopSalesOrderItemTransfer;
87
    }
88
89
    /**
90
     * @param \Propel\Runtime\Collection\ObjectCollection $paymentComputopOrderItemEntityCollection
91
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer $computopPaymentComputopOrderItemCollectionTransfer
92
     *
93
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer
94
     */
95
    public function mapPaymentComputopOrderItemEntityCollectionToComputopPaymentComputopOrderItemTransferCollection(
96
        ObjectCollection $paymentComputopOrderItemEntityCollection,
97
        ComputopPaymentComputopOrderItemCollectionTransfer $computopPaymentComputopOrderItemCollectionTransfer
98
    ): ComputopPaymentComputopOrderItemCollectionTransfer {
99
        foreach ($paymentComputopOrderItemEntityCollection as $paymentComputopOrderItemEntity) {
100
            $computopPaymentOrderItemTransfer = $this
101
                ->mapPaymentComputopOrderItemEntityToComputopPaymentComputopOrderItemTransfer(
102
                    $paymentComputopOrderItemEntity,
103
                    new ComputopPaymentComputopOrderItemTransfer()
104
                );
105
            $computopPaymentComputopOrderItemCollectionTransfer->addComputopPaymentComputopOrderItem($computopPaymentOrderItemTransfer);
106
        }
107
108
        return $computopPaymentComputopOrderItemCollectionTransfer;
109
    }
110
111
    /**
112
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem
113
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer
114
     *
115
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer
116
     */
117
    public function mapPaymentComputopOrderItemEntityToComputopPaymentComputopOrderItemTransfer(
118
        SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem,
119
        ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer
120
    ): ComputopPaymentComputopOrderItemTransfer {
121
        $computopPaymentComputopOrderItemTransfer->fromArray($spyPaymentComputopOrderItem->toArray(), true);
122
        $computopPaymentComputopOrderItemTransfer->setIsNew($spyPaymentComputopOrderItem->isNew());
123
124
        return $computopPaymentComputopOrderItemTransfer;
125
    }
126
127
    /**
128
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer
129
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem
130
     *
131
     * @return \Orm\Zed\Computop\Persistence\SpyPaymentComputopOrderItem
132
     */
133
    public function mapComputopPaymentComputopOrderItemTransferToPaymentComputopOrderItemEntity(
134
        ComputopPaymentComputopOrderItemTransfer $computopPaymentComputopOrderItemTransfer,
135
        SpyPaymentComputopOrderItem $spyPaymentComputopOrderItem
136
    ): SpyPaymentComputopOrderItem {
137
        $spyPaymentComputopOrderItem->fromArray($computopPaymentComputopOrderItemTransfer->toArray());
138
        $spyPaymentComputopOrderItem->setNew($computopPaymentComputopOrderItemTransfer->getIsNew());
139
140
        return $spyPaymentComputopOrderItem;
141
    }
142
143
    /**
144
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputopDetail $paymentComputopDetailEntity
145
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopDetailTransfer $computopPaymentComputopDetailTransfer
146
     *
147
     * @return \Generated\Shared\Transfer\ComputopPaymentComputopDetailTransfer
148
     */
149
    public function mapPaymentComputopDetailEntityToComputopPaymentComputopDetailTransfer(
150
        SpyPaymentComputopDetail $paymentComputopDetailEntity,
151
        ComputopPaymentComputopDetailTransfer $computopPaymentComputopDetailTransfer
152
    ): ComputopPaymentComputopDetailTransfer {
153
        $computopPaymentComputopDetailTransfer->fromArray($paymentComputopDetailEntity->toArray(), true);
154
155
        return $computopPaymentComputopDetailTransfer;
156
    }
157
158
    /**
159
     * @param \Generated\Shared\Transfer\ComputopPaymentComputopDetailTransfer $computopPaymentComputopTransfer
160
     * @param \Orm\Zed\Computop\Persistence\SpyPaymentComputopDetail $paymentComputopDetailEntity
161
     *
162
     * @return \Orm\Zed\Computop\Persistence\SpyPaymentComputopDetail
163
     */
164
    public function mapComputopPaymentComputopDetailTransferToPaymentComputopDetailEntity(
165
        ComputopPaymentComputopDetailTransfer $computopPaymentComputopTransfer,
166
        SpyPaymentComputopDetail $paymentComputopDetailEntity
167
    ): SpyPaymentComputopDetail {
168
        $paymentComputopDetailEntity->fromArray($computopPaymentComputopTransfer->toArray());
169
170
        return $paymentComputopDetailEntity;
171
    }
172
}
173