|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. |
|
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\PunchoutCatalogs\Persistence; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\PunchoutCatalogConnectionTransfer; |
|
|
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\PunchoutCatalogTransactionTransfer; |
|
|
|
|
|
|
12
|
|
|
use Orm\Zed\CompanyBusinessUnit\Persistence\Map\SpyCompanyBusinessUnitTableMap; |
|
|
|
|
|
|
13
|
|
|
use Orm\Zed\CompanyUser\Persistence\Map\SpyCompanyUserTableMap; |
|
|
|
|
|
|
14
|
|
|
use Propel\Runtime\ActiveQuery\Criteria; |
|
15
|
|
|
use Spryker\Zed\Kernel\Persistence\AbstractRepository; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* @method \SprykerEco\Zed\PunchoutCatalogs\Persistence\PunchoutCatalogsPersistenceFactory getFactory() |
|
19
|
|
|
*/ |
|
20
|
|
|
class PunchoutCatalogsRepository extends AbstractRepository implements PunchoutCatalogsRepositoryInterface |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @param int $idConnection |
|
24
|
|
|
* |
|
25
|
|
|
* @return \Generated\Shared\Transfer\PunchoutCatalogConnectionTransfer|null |
|
26
|
|
|
*/ |
|
27
|
|
|
public function findConnectionById(int $idConnection): ?PunchoutCatalogConnectionTransfer |
|
28
|
|
|
{ |
|
29
|
|
|
$punchoutCatalogConnectionEntity = $this->getFactory() |
|
30
|
|
|
->getPunchoutCatalogConnectionPropelQuery() |
|
31
|
|
|
->filterByIdPunchoutCatalogConnection($idConnection) |
|
32
|
|
|
->leftJoinWithPgwPunchoutCatalogConnectionCart() |
|
33
|
|
|
->leftJoinWithPgwPunchoutCatalogConnectionSetup() |
|
34
|
|
|
->findOne(); |
|
35
|
|
|
|
|
36
|
|
|
if ($punchoutCatalogConnectionEntity === null) { |
|
37
|
|
|
return null; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
return $this->getFactory() |
|
41
|
|
|
->createPunchoutCatalogsConnectionMapper() |
|
42
|
|
|
->mapPunchoutCatalogConnectionEntityToTransfer( |
|
43
|
|
|
$punchoutCatalogConnectionEntity, |
|
44
|
|
|
new PunchoutCatalogConnectionTransfer() |
|
45
|
|
|
); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param int $idPunchoutCatalogTransaction |
|
50
|
|
|
* |
|
51
|
|
|
* @return \Generated\Shared\Transfer\PunchoutCatalogTransactionTransfer|null |
|
52
|
|
|
*/ |
|
53
|
|
|
public function findTransactionById(int $idPunchoutCatalogTransaction): ?PunchoutCatalogTransactionTransfer |
|
54
|
|
|
{ |
|
55
|
|
|
$punchoutCatalogTransactionEntity = $this->getFactory() |
|
56
|
|
|
->getPunchoutCatalogTransactionPropelQuery() |
|
57
|
|
|
->leftJoinWithPunchoutCatalogConnection() |
|
58
|
|
|
->filterByIdPunchoutCatalogTransaction($idPunchoutCatalogTransaction) |
|
59
|
|
|
->findOne(); |
|
60
|
|
|
|
|
61
|
|
|
if (!$punchoutCatalogTransactionEntity) { |
|
62
|
|
|
return null; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
return $this->getFactory() |
|
66
|
|
|
->createPunchoutCatalogsConnectionMapper() |
|
67
|
|
|
->mapPunchoutCatalogTransactionEntityToTransfer( |
|
68
|
|
|
$punchoutCatalogTransactionEntity, |
|
69
|
|
|
new PunchoutCatalogTransactionTransfer() |
|
70
|
|
|
); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @module CompanyBusinessUnit |
|
75
|
|
|
* @module Company |
|
76
|
|
|
* @module Customer |
|
77
|
|
|
* |
|
78
|
|
|
* @param int $idCompanyBusinessUnit |
|
79
|
|
|
* |
|
80
|
|
|
* @return int[] |
|
81
|
|
|
*/ |
|
82
|
|
|
public function getActiveCompanyUserIdsByIdCompanyBusinessUnit(int $idCompanyBusinessUnit): array |
|
83
|
|
|
{ |
|
84
|
|
|
return $this->getFactory() |
|
85
|
|
|
->getCompanyUserPropelQuery() |
|
86
|
|
|
->useCompanyQuery(null, Criteria::INNER_JOIN) |
|
87
|
|
|
->filterByIsActive(true) |
|
88
|
|
|
->endUse() |
|
89
|
|
|
->useCustomerQuery(null, Criteria::INNER_JOIN) |
|
90
|
|
|
->filterByAnonymizedAt(null) |
|
91
|
|
|
->endUse() |
|
92
|
|
|
->filterByIsActive(true) |
|
93
|
|
|
->filterByFkCompanyBusinessUnit($idCompanyBusinessUnit) |
|
94
|
|
|
->select(SpyCompanyUserTableMap::COL_ID_COMPANY_USER) |
|
95
|
|
|
->find() |
|
96
|
|
|
->toArray(); |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* @module Company |
|
101
|
|
|
* |
|
102
|
|
|
* @param int $parentCompanyBusinessUnitId |
|
103
|
|
|
* |
|
104
|
|
|
* @return int[] |
|
105
|
|
|
*/ |
|
106
|
|
|
public function getActiveCompanyBusinessUnitIdsByParentCompanyBusinessUnitId(int $parentCompanyBusinessUnitId): array |
|
107
|
|
|
{ |
|
108
|
|
|
return $this->getFactory() |
|
109
|
|
|
->getCompanyBusinessUnitPropelQuery() |
|
110
|
|
|
->useCompanyQuery(null, Criteria::INNER_JOIN) |
|
111
|
|
|
->filterByIsActive(true) |
|
112
|
|
|
->endUse() |
|
113
|
|
|
->filterByFkParentCompanyBusinessUnit($parentCompanyBusinessUnitId) |
|
114
|
|
|
->select(SpyCompanyBusinessUnitTableMap::COL_ID_COMPANY_BUSINESS_UNIT) |
|
115
|
|
|
->find() |
|
116
|
|
|
->toArray(); |
|
117
|
|
|
} |
|
118
|
|
|
} |
|
119
|
|
|
|
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