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; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\ComputopPaymentComputopDetailTransfer; |
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer; |
|
|
|
|
12
|
|
|
use Generated\Shared\Transfer\ComputopPaymentComputopTransfer; |
|
|
|
|
13
|
|
|
use Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer; |
|
|
|
|
14
|
|
|
use Spryker\Zed\Kernel\Persistence\AbstractRepository; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @method \SprykerEco\Zed\Computop\Persistence\ComputopPersistenceFactory getFactory(); |
18
|
|
|
*/ |
19
|
|
|
class ComputopRepository extends AbstractRepository implements ComputopRepositoryInterface |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @param string $transactionId |
23
|
|
|
* |
24
|
|
|
* @return \Generated\Shared\Transfer\ComputopPaymentComputopTransfer|null |
25
|
|
|
*/ |
26
|
|
|
public function findComputopPaymentByComputopTransId(string $transactionId): ?ComputopPaymentComputopTransfer |
27
|
|
|
{ |
28
|
|
|
$computopPaymentEntity = $this->getFactory() |
29
|
|
|
->getPaymentComputopQuery() |
30
|
|
|
->filterByTransId($transactionId) |
31
|
|
|
->findOne(); |
32
|
|
|
|
33
|
|
|
if ($computopPaymentEntity === null) { |
34
|
|
|
return null; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
return $this->getFactory() |
38
|
|
|
->createComputopMapper() |
39
|
|
|
->mapComputopPaymentEntityToComputopPaymentTransfer($computopPaymentEntity, new ComputopPaymentComputopTransfer()); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentComputopTransfer |
44
|
|
|
* |
45
|
|
|
* @return \Generated\Shared\Transfer\ComputopSalesOrderItemCollectionTransfer |
46
|
|
|
*/ |
47
|
|
|
public function getComputopSalesOrderItemsCollection( |
48
|
|
|
ComputopPaymentComputopTransfer $computopPaymentComputopTransfer |
49
|
|
|
): ComputopSalesOrderItemCollectionTransfer { |
50
|
|
|
$salesOrderItemsCollection = $this->getFactory() |
51
|
|
|
->getSpySalesOrderItemQuery() |
52
|
|
|
->filterByFkSalesOrder($computopPaymentComputopTransfer->getFKSalesOrder()) |
53
|
|
|
->find(); |
54
|
|
|
|
55
|
|
|
if ($salesOrderItemsCollection->count() === 0) { |
56
|
|
|
return new ComputopSalesOrderItemCollectionTransfer(); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
return $this->getFactory() |
60
|
|
|
->createComputopMapper() |
61
|
|
|
->mapSalesOrderItemsCollectionToComputopSalesOrderItemCollectionTransfer( |
62
|
|
|
$salesOrderItemsCollection, |
63
|
|
|
new ComputopSalesOrderItemCollectionTransfer() |
64
|
|
|
); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentComputopTransfer |
69
|
|
|
* |
70
|
|
|
* @return \Generated\Shared\Transfer\ComputopPaymentComputopOrderItemCollectionTransfer |
71
|
|
|
*/ |
72
|
|
|
public function getComputopPaymentComputopOrderItemsCollection( |
73
|
|
|
ComputopPaymentComputopTransfer $computopPaymentComputopTransfer |
74
|
|
|
): ComputopPaymentComputopOrderItemCollectionTransfer { |
75
|
|
|
$computopPaymentComputopOrderItemsEntityCollection = $this->getFactory() |
76
|
|
|
->getPaymentComputopOrderItemQuery() |
77
|
|
|
->filterByFkPaymentComputop($computopPaymentComputopTransfer->getIdPaymentComputop()) |
78
|
|
|
->find(); |
79
|
|
|
|
80
|
|
|
if ($computopPaymentComputopOrderItemsEntityCollection->count() === 0) { |
81
|
|
|
return new ComputopPaymentComputopOrderItemCollectionTransfer(); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
return $this->getFactory() |
85
|
|
|
->createComputopMapper() |
86
|
|
|
->mapPaymentComputopOrderItemEntityCollectionToComputopPaymentComputopOrderItemTransferCollection( |
87
|
|
|
$computopPaymentComputopOrderItemsEntityCollection, |
88
|
|
|
new ComputopPaymentComputopOrderItemCollectionTransfer() |
89
|
|
|
); |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param \Generated\Shared\Transfer\ComputopPaymentComputopTransfer $computopPaymentComputopTransfer |
94
|
|
|
* |
95
|
|
|
* @return \Generated\Shared\Transfer\ComputopPaymentComputopDetailTransfer|null |
96
|
|
|
*/ |
97
|
|
|
public function findComputopPaymentDetail( |
98
|
|
|
ComputopPaymentComputopTransfer $computopPaymentComputopTransfer |
99
|
|
|
): ?ComputopPaymentComputopDetailTransfer { |
100
|
|
|
$paymentComputopDetailEntity = $this->getFactory() |
101
|
|
|
->getPaymentComputopDetailQuery() |
102
|
|
|
->filterByIdPaymentComputop($computopPaymentComputopTransfer->getIdPaymentComputop()) |
103
|
|
|
->findOne(); |
104
|
|
|
|
105
|
|
|
if ($paymentComputopDetailEntity === null) { |
106
|
|
|
return null; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
return $this->getFactory() |
110
|
|
|
->createComputopMapper() |
111
|
|
|
->mapPaymentComputopDetailEntityToComputopPaymentComputopDetailTransfer( |
112
|
|
|
$paymentComputopDetailEntity, |
113
|
|
|
new ComputopPaymentComputopDetailTransfer() |
114
|
|
|
); |
115
|
|
|
} |
116
|
|
|
} |
117
|
|
|
|
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