1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\CrefoPay\Persistence\Mapper; |
9
|
|
|
|
10
|
|
|
use ArrayObject; |
11
|
|
|
use Generated\Shared\Transfer\PaymentCrefoPayNotificationTransfer; |
|
|
|
|
12
|
|
|
use Generated\Shared\Transfer\PaymentCrefoPayOrderItemCollectionTransfer; |
|
|
|
|
13
|
|
|
use Generated\Shared\Transfer\PaymentCrefoPayOrderItemToCrefoPayApiLogTransfer; |
|
|
|
|
14
|
|
|
use Generated\Shared\Transfer\PaymentCrefoPayOrderItemToCrefoPayNotificationTransfer; |
|
|
|
|
15
|
|
|
use Generated\Shared\Transfer\PaymentCrefoPayOrderItemTransfer; |
|
|
|
|
16
|
|
|
use Generated\Shared\Transfer\PaymentCrefoPayTransfer; |
|
|
|
|
17
|
|
|
use Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPay; |
|
|
|
|
18
|
|
|
use Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayNotification; |
|
|
|
|
19
|
|
|
use Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItem; |
|
|
|
|
20
|
|
|
use Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItemToCrefoPayApiLog; |
|
|
|
|
21
|
|
|
use Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItemToCrefoPayNotification; |
|
|
|
|
22
|
|
|
use Propel\Runtime\Collection\ObjectCollection; |
23
|
|
|
|
24
|
|
|
class CrefoPayPersistenceMapper |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItem> $paymentCrefoPayOrderItemEntities |
28
|
|
|
* @param \Generated\Shared\Transfer\PaymentCrefoPayOrderItemCollectionTransfer $crefoPayOrderItemCollectionTransfer |
29
|
|
|
* |
30
|
|
|
* @return \Generated\Shared\Transfer\PaymentCrefoPayOrderItemCollectionTransfer |
31
|
|
|
*/ |
32
|
|
|
public function mapOrderItemEntitiesToOrderItemCollection( |
33
|
|
|
ObjectCollection $paymentCrefoPayOrderItemEntities, |
34
|
|
|
PaymentCrefoPayOrderItemCollectionTransfer $crefoPayOrderItemCollectionTransfer |
35
|
|
|
): PaymentCrefoPayOrderItemCollectionTransfer { |
36
|
|
|
$result = new ArrayObject(); |
37
|
|
|
|
38
|
|
|
foreach ($paymentCrefoPayOrderItemEntities as $paymentCrefoPayOrderItemEntity) { |
39
|
|
|
$paymentCrefoPayOrderItemTransfer = $this->mapEntityToPaymentCrefoPayOrderItemTransfer( |
40
|
|
|
$paymentCrefoPayOrderItemEntity, |
41
|
|
|
new PaymentCrefoPayOrderItemTransfer(), |
42
|
|
|
); |
43
|
|
|
$result->append($paymentCrefoPayOrderItemTransfer); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
return $crefoPayOrderItemCollectionTransfer |
47
|
|
|
->setCrefoPayOrderItems($result); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param \Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPay $paymentCrefoPayEntity |
52
|
|
|
* @param \Generated\Shared\Transfer\PaymentCrefoPayTransfer $paymentCrefoPayTransfer |
53
|
|
|
* |
54
|
|
|
* @return \Generated\Shared\Transfer\PaymentCrefoPayTransfer |
55
|
|
|
*/ |
56
|
|
|
public function mapEntityToPaymentCrefoPayTransfer( |
57
|
|
|
SpyPaymentCrefoPay $paymentCrefoPayEntity, |
58
|
|
|
PaymentCrefoPayTransfer $paymentCrefoPayTransfer |
59
|
|
|
): PaymentCrefoPayTransfer { |
60
|
|
|
$paymentCrefoPayTransfer->fromArray( |
61
|
|
|
$paymentCrefoPayEntity->toArray(), |
62
|
|
|
true, |
63
|
|
|
)->setIdSalesOrder($paymentCrefoPayEntity->getFkSalesOrder()); |
64
|
|
|
|
65
|
|
|
return $paymentCrefoPayTransfer; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @param \Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItem $paymentCrefoPayOrderItemEntity |
70
|
|
|
* @param \Generated\Shared\Transfer\PaymentCrefoPayOrderItemTransfer $paymentCrefoPayOrderItemTransfer |
71
|
|
|
* |
72
|
|
|
* @return \Generated\Shared\Transfer\PaymentCrefoPayOrderItemTransfer |
73
|
|
|
*/ |
74
|
|
|
public function mapEntityToPaymentCrefoPayOrderItemTransfer( |
75
|
|
|
SpyPaymentCrefoPayOrderItem $paymentCrefoPayOrderItemEntity, |
76
|
|
|
PaymentCrefoPayOrderItemTransfer $paymentCrefoPayOrderItemTransfer |
77
|
|
|
): PaymentCrefoPayOrderItemTransfer { |
78
|
|
|
$paymentCrefoPayOrderItemTransfer |
79
|
|
|
->fromArray($paymentCrefoPayOrderItemEntity->toArray(), true) |
80
|
|
|
->setIdPaymentCrefoPay($paymentCrefoPayOrderItemEntity->getFkPaymentCrefoPay()) |
81
|
|
|
->setIdSalesOrderItem($paymentCrefoPayOrderItemEntity->getFkSalesOrderItem()); |
82
|
|
|
|
83
|
|
|
return $paymentCrefoPayOrderItemTransfer; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @param \Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayNotification $paymentCrefoPayNotificationEntity |
88
|
|
|
* @param \Generated\Shared\Transfer\PaymentCrefoPayNotificationTransfer $paymentCrefoPayNotificationTransfer |
89
|
|
|
* |
90
|
|
|
* @return \Generated\Shared\Transfer\PaymentCrefoPayNotificationTransfer |
91
|
|
|
*/ |
92
|
|
|
public function mapEntityToPaymentCrefoPayNotificationTransfer( |
93
|
|
|
SpyPaymentCrefoPayNotification $paymentCrefoPayNotificationEntity, |
94
|
|
|
PaymentCrefoPayNotificationTransfer $paymentCrefoPayNotificationTransfer |
95
|
|
|
): PaymentCrefoPayNotificationTransfer { |
96
|
|
|
$paymentCrefoPayNotificationTransfer->fromArray( |
97
|
|
|
$paymentCrefoPayNotificationEntity->toArray(), |
98
|
|
|
true, |
99
|
|
|
); |
100
|
|
|
|
101
|
|
|
return $paymentCrefoPayNotificationTransfer; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param \Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItemToCrefoPayApiLog $paymentCrefoPayOrderItemToCrefoPayApiLogEntity |
106
|
|
|
* @param \Generated\Shared\Transfer\PaymentCrefoPayOrderItemToCrefoPayApiLogTransfer $paymentCrefoPayOrderItemToCrefoPayApiLogTransfer |
107
|
|
|
* |
108
|
|
|
* @return \Generated\Shared\Transfer\PaymentCrefoPayOrderItemToCrefoPayApiLogTransfer |
109
|
|
|
*/ |
110
|
|
|
public function mapEntityToPaymentCrefoPayOrderItemToCrefoPayApiLogTransfer( |
111
|
|
|
SpyPaymentCrefoPayOrderItemToCrefoPayApiLog $paymentCrefoPayOrderItemToCrefoPayApiLogEntity, |
112
|
|
|
PaymentCrefoPayOrderItemToCrefoPayApiLogTransfer $paymentCrefoPayOrderItemToCrefoPayApiLogTransfer |
113
|
|
|
): PaymentCrefoPayOrderItemToCrefoPayApiLogTransfer { |
114
|
|
|
$paymentCrefoPayOrderItemToCrefoPayApiLogTransfer |
115
|
|
|
->fromArray($paymentCrefoPayOrderItemToCrefoPayApiLogEntity->toArray(), true) |
116
|
|
|
->setIdPaymentCrefoPayOrderItem($paymentCrefoPayOrderItemToCrefoPayApiLogEntity->getFkPaymentCrefoPayOrderItem()) |
117
|
|
|
->setIdPaymentCrefoPayApiLog($paymentCrefoPayOrderItemToCrefoPayApiLogEntity->getFkPaymentCrefoPayApiLog()); |
118
|
|
|
|
119
|
|
|
return $paymentCrefoPayOrderItemToCrefoPayApiLogTransfer; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param \Orm\Zed\CrefoPay\Persistence\SpyPaymentCrefoPayOrderItemToCrefoPayNotification $paymentCrefoPayOrderItemToCrefoPayNotificationEntity |
124
|
|
|
* @param \Generated\Shared\Transfer\PaymentCrefoPayOrderItemToCrefoPayNotificationTransfer $paymentCrefoPayOrderItemToCrefoPayNotificationTransfer |
125
|
|
|
* |
126
|
|
|
* @return \Generated\Shared\Transfer\PaymentCrefoPayOrderItemToCrefoPayNotificationTransfer |
127
|
|
|
*/ |
128
|
|
|
public function mapEntityToPaymentCrefoPayOrderItemToCrefoPayNotificationTransfer( |
129
|
|
|
SpyPaymentCrefoPayOrderItemToCrefoPayNotification $paymentCrefoPayOrderItemToCrefoPayNotificationEntity, |
130
|
|
|
PaymentCrefoPayOrderItemToCrefoPayNotificationTransfer $paymentCrefoPayOrderItemToCrefoPayNotificationTransfer |
131
|
|
|
): PaymentCrefoPayOrderItemToCrefoPayNotificationTransfer { |
132
|
|
|
$paymentCrefoPayOrderItemToCrefoPayNotificationTransfer |
133
|
|
|
->fromArray($paymentCrefoPayOrderItemToCrefoPayNotificationEntity->toArray(), true) |
134
|
|
|
->setIdPaymentCrefoPayOrderItem($paymentCrefoPayOrderItemToCrefoPayNotificationEntity->getFkPaymentCrefoPayOrderItem()) |
135
|
|
|
->setIdPaymentCrefoPayNotification($paymentCrefoPayOrderItemToCrefoPayNotificationEntity->getFkPaymentCrefoPayNotification()); |
136
|
|
|
|
137
|
|
|
return $paymentCrefoPayOrderItemToCrefoPayNotificationTransfer; |
138
|
|
|
} |
139
|
|
|
} |
140
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths