getPunchoutCatalogFacade()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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\Communication;
9
10
use Generated\Shared\Transfer\PunchoutCatalogConnectionTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...talogConnectionTransfer 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 Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...tCatalogConnectionQuery 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 Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogTransactionQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\PunchoutCatalog\...CatalogTransactionQuery 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 Spryker\Zed\Kernel\Communication\AbstractCommunicationFactory;
14
use SprykerEco\Zed\PunchoutCatalogs\Communication\Form\DataProvider\PunchoutCatalogConnectionFormDataProvider;
15
use SprykerEco\Zed\PunchoutCatalogs\Communication\Form\DataProvider\PunchoutCatalogSetupRequestConnectionTypeFormDataProvider;
16
use SprykerEco\Zed\PunchoutCatalogs\Communication\Form\PunchoutCatalogConnectionForm;
17
use SprykerEco\Zed\PunchoutCatalogs\Communication\Table\PunchoutCatalogsConnectionsTable;
18
use SprykerEco\Zed\PunchoutCatalogs\Communication\Table\PunchoutCatalogsTransactionLogTable;
19
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToCompanyBusinessUnitFacadeInterface;
20
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToCompanyUserFacadeInterface;
21
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToPunchoutCatalogFacadeInterface;
22
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Service\PunchoutCatalogsToUtilDateTimeServiceInterface;
23
use SprykerEco\Zed\PunchoutCatalogs\PunchoutCatalogsDependencyProvider;
24
use Symfony\Component\Form\FormInterface;
25
26
/**
27
 * @method \SprykerEco\Zed\PunchoutCatalogs\Persistence\PunchoutCatalogsRepositoryInterface getRepository()
28
 * @method \SprykerEco\Zed\PunchoutCatalogs\Persistence\PunchoutCatalogsEntityManagerInterface getEntityManager()
29
 * @method \SprykerEco\Zed\PunchoutCatalogs\Business\PunchoutCatalogsFacadeInterface getFacade()
30
 * @method \SprykerEco\Zed\PunchoutCatalogs\PunchoutCatalogsConfig getConfig()
31
 */
32
class PunchoutCatalogsCommunicationFactory extends AbstractCommunicationFactory
33
{
34
    /**
35
     * @return \SprykerEco\Zed\PunchoutCatalogs\Communication\Table\PunchoutCatalogsConnectionsTable
36
     */
37
    public function createPunchoutCatalogsConnectionsTable(): PunchoutCatalogsConnectionsTable
38
    {
39
        return new PunchoutCatalogsConnectionsTable(
40
            $this->getPunchoutCatalogConnectionPropelQuery(),
41
            $this->getUtilDateTimeService()
42
        );
43
    }
44
45
    /**
46
     * @return \SprykerEco\Zed\PunchoutCatalogs\Communication\Table\PunchoutCatalogsTransactionLogTable
47
     */
48
    public function createPunchoutCatalogsTransactionLogTable(): PunchoutCatalogsTransactionLogTable
49
    {
50
        return new PunchoutCatalogsTransactionLogTable(
51
            $this->getPunchoutCatalogTransactionPropelQuery(),
52
            $this->getUtilDateTimeService()
53
        );
54
    }
55
56
    /**
57
     * @param \Generated\Shared\Transfer\PunchoutCatalogConnectionTransfer|null $punchoutCatalogConnectionTransfer
58
     *
59
     * @return \Symfony\Component\Form\FormInterface
60
     */
61
    public function getPunchoutCatalogConnectionForm(?PunchoutCatalogConnectionTransfer $punchoutCatalogConnectionTransfer = null): FormInterface
62
    {
63
        $punchoutCatalogConnectionFormDataProvider = $this->createPunchoutCatalogConnectionFormDataProvider();
64
65
        return $this->getFormFactory()
66
            ->create(
67
                PunchoutCatalogConnectionForm::class,
68
                $punchoutCatalogConnectionFormDataProvider->getData($punchoutCatalogConnectionTransfer),
69
                $punchoutCatalogConnectionFormDataProvider->getOptions()
70
            );
71
    }
72
73
    /**
74
     * @return \SprykerEco\Zed\PunchoutCatalogs\Communication\Form\DataProvider\PunchoutCatalogConnectionFormDataProvider
75
     */
76
    public function createPunchoutCatalogConnectionFormDataProvider(): PunchoutCatalogConnectionFormDataProvider
77
    {
78
        return new PunchoutCatalogConnectionFormDataProvider(
79
            $this->getCompanyBusinessUnitFacade(),
80
            $this->getPunchoutCatalogConnectionFormatPlugins(),
81
            $this->getPunchoutCatalogConnectionTypePlugins()
82
        );
83
    }
84
85
    /**
86
     * @return \SprykerEco\Zed\PunchoutCatalogs\Communication\Form\DataProvider\PunchoutCatalogSetupRequestConnectionTypeFormDataProvider
87
     */
88
    public function createPunchoutCatalogSetupRequestConnectionTypeFormDataProvider(): PunchoutCatalogSetupRequestConnectionTypeFormDataProvider
89
    {
90
        return new PunchoutCatalogSetupRequestConnectionTypeFormDataProvider(
91
            $this->getCompanyBusinessUnitFacade(),
92
            $this->getCompanyUserFacade(),
93
            $this->getRepository()
94
        );
95
    }
96
97
    /**
98
     * @return \Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogConnectionQuery
99
     */
100
    public function getPunchoutCatalogConnectionPropelQuery(): PgwPunchoutCatalogConnectionQuery
101
    {
102
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::PROPEL_QUERY_PUNCHOUT_CATALOG_CONNECTION);
103
    }
104
105
    /**
106
     * @return \Orm\Zed\PunchoutCatalog\Persistence\PgwPunchoutCatalogTransactionQuery
107
     */
108
    public function getPunchoutCatalogTransactionPropelQuery(): PgwPunchoutCatalogTransactionQuery
109
    {
110
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::PROPEL_QUERY_PUNCHOUT_CATALOG_TRANSACTION);
111
    }
112
113
    /**
114
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Service\PunchoutCatalogsToUtilDateTimeServiceInterface
115
     */
116
    public function getUtilDateTimeService(): PunchoutCatalogsToUtilDateTimeServiceInterface
117
    {
118
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::SERVICE_UTIL_DATE_TIME);
119
    }
120
121
    /**
122
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToCompanyBusinessUnitFacadeInterface
123
     */
124
    public function getCompanyBusinessUnitFacade(): PunchoutCatalogsToCompanyBusinessUnitFacadeInterface
125
    {
126
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::FACADE_COMPANY_BUSINESS_UNIT);
127
    }
128
129
    /**
130
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToCompanyUserFacadeInterface
131
     */
132
    public function getCompanyUserFacade(): PunchoutCatalogsToCompanyUserFacadeInterface
133
    {
134
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::FACADE_COMPANY_USER);
135
    }
136
137
    /**
138
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToPunchoutCatalogFacadeInterface
139
     */
140
    public function getPunchoutCatalogFacade(): PunchoutCatalogsToPunchoutCatalogFacadeInterface
141
    {
142
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::FACADE_PUNCHOUT_CATALOG);
143
    }
144
145
    /**
146
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Plugin\PunchoutCatalogConnectionFormatPluginInterface[]
147
     */
148
    public function getPunchoutCatalogConnectionFormatPlugins(): array
149
    {
150
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::PLUGINS_PUNCHOUT_CATALOG_CONNECTION_FORMAT);
151
    }
152
153
    /**
154
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Plugin\PunchoutCatalogConnectionTypePluginInterface[]
155
     */
156
    public function getPunchoutCatalogConnectionTypePlugins(): array
157
    {
158
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::PLUGINS_PUNCHOUT_CATALOG_CONNECTION_TYPE);
159
    }
160
161
    /**
162
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Plugin\PunchoutCatalogSetupRequestFormExtensionPluginInterface[]
163
     */
164
    public function getPunchoutCatalogSetupRequestFormExtensionPlugins(): array
165
    {
166
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::PLUGINS_PUNCHOUT_CATALOG_SETUP_REQUEST_FORM_EXTENSION);
167
    }
168
}
169