Passed
Pull Request — dev (#4)
by Mykyta
11:52 queued 07:39
created

queryRegistrationByIdAndQuoteHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
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\Heidelpay\Persistence;
9
10
use Spryker\Zed\Kernel\Persistence\AbstractQueryContainer;
11
use Spryker\Zed\PropelOrm\Business\Runtime\ActiveQuery\Criteria;
12
use SprykerEco\Shared\Heidelpay\HeidelpayConfig;
13
14
/**
15
 * @method \SprykerEco\Zed\Heidelpay\Persistence\HeidelpayPersistenceFactory getFactory()
16
 */
17
class HeidelpayQueryContainer extends AbstractQueryContainer implements HeidelpayQueryContainerInterface
18
{
19
    /**
20
     * @api
21
     *
22
     * @param int $idSalesOrder
23
     *
24
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayTransactionLogQuery
1 ignored issue
show
Bug introduced by
The type Orm\Zed\Heidelpay\Persis...lpayTransactionLogQuery 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...
25
     */
26
    public function queryExternalResponseTransactionLog($idSalesOrder)
27
    {
28
        return $this->getFactory()
29
            ->createPaymentHeidelpayTransactionLogQuery()
30
            ->filterByFkSalesOrder($idSalesOrder)
31
            ->filterByTransactionType(HeidelpayConfig::TRANSACTION_TYPE_EXTERNAL_RESPONSE);
32
    }
33
34
    /**
35
     * @api
36
     *
37
     * @param int $idSalesOrder
38
     *
39
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayTransactionLogQuery
40
     */
41
    public function queryCaptureTransactionLog($idSalesOrder)
42
    {
43
        return $this->getFactory()
44
            ->createPaymentHeidelpayTransactionLogQuery()
45
            ->filterByFkSalesOrder($idSalesOrder)
46
            ->filterByTransactionType(HeidelpayConfig::TRANSACTION_TYPE_CAPTURE);
47
    }
48
49
    /**
50
     * @api
51
     *
52
     * @param int $idSalesOrder
53
     *
54
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayQuery
1 ignored issue
show
Bug introduced by
The type Orm\Zed\Heidelpay\Persis...pyPaymentHeidelpayQuery 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...
55
     */
56
    public function queryPaymentByIdSalesOrder($idSalesOrder)
57
    {
58
        return $this
59
            ->getFactory()
60
            ->createPaymentHeidelpayQuery()
61
            ->filterByFkSalesOrder($idSalesOrder);
62
    }
63
64
    /**
65
     * @api
66
     *
67
     * @param int $idSalesOrder
68
     * @param string $transactionType
69
     *
70
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayTransactionLogQuery
71
     */
72
    public function queryTransactionByIdSalesOrderAndType($idSalesOrder, $transactionType)
73
    {
74
        return $this->getFactory()
75
            ->createPaymentHeidelpayTransactionLogQuery()
76
            ->filterByFkSalesOrder($idSalesOrder)
77
            ->filterByTransactionType($transactionType);
78
    }
79
80
    /**
81
     * @api
82
     *
83
     * @param string $registrationNumber
84
     *
85
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayCreditCardRegistrationQuery
1 ignored issue
show
Bug introduced by
The type Orm\Zed\Heidelpay\Persis...itCardRegistrationQuery 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...
86
     */
87
    public function queryCreditCardRegistrationByRegistrationNumber($registrationNumber)
88
    {
89
        return $this->getFactory()
90
            ->createHeidelpayCreditCardRegistrationQuery()
91
            ->filterByRegistrationNumber($registrationNumber);
92
    }
93
94
    /**
95
     * @api
96
     *
97
     * @param int $idAddress
98
     *
99
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayCreditCardRegistrationQuery
100
     */
101
    public function queryLatestRegistrationByIdShippingAddress($idAddress)
102
    {
103
        return $this->getFactory()
104
            ->createHeidelpayCreditCardRegistrationQuery()
105
            ->filterByFkCustomerAddress($idAddress)
106
            ->orderByIdCreditCardRegistration(Criteria::DESC);
107
    }
108
109
    /**
110
     * @api
111
     *
112
     * @param int $idRegistration
113
     * @param string $quoteHash
114
     *
115
     * @return \Orm\Zed\Heidelpay\Persistence\SpyPaymentHeidelpayCreditCardRegistrationQuery
116
     */
117
    public function queryRegistrationByIdAndQuoteHash($idRegistration, $quoteHash)
118
    {
119
        return $this->getFactory()
120
            ->createHeidelpayCreditCardRegistrationQuery()
121
            ->filterByIdCreditCardRegistration($idRegistration)
122
            ->filterByQuoteHash($quoteHash);
123
    }
124
}
125