Passed
Push — feature/paypal-express ( c7cc4d...3ba955 )
by Volodymyr
08:56 queued 04:06
created

queryTransactionStatusLog()   A

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
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\Braintree\Persistence;
9
10
use Orm\Zed\Braintree\Persistence\Map\SpyPaymentBraintreeTransactionRequestLogTableMap;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Braintree\Persis...ctionRequestLogTableMap 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\Braintree\Persistence\Map\SpyPaymentBraintreeTransactionStatusLogTableMap;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Braintree\Persis...actionStatusLogTableMap 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 Propel\Runtime\Propel;
13
use Spryker\Zed\Kernel\Persistence\AbstractQueryContainer;
14
15
/**
16
 * @method \SprykerEco\Zed\Braintree\Persistence\BraintreePersistenceFactory getFactory()
17
 */
18
class BraintreeQueryContainer extends AbstractQueryContainer implements BraintreeQueryContainerInterface
19
{
20
    /**
21
     * @api
22
     *
23
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeQuery
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Braintree\Persis...pyPaymentBraintreeQuery 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...
24
     */
25
    public function queryPayments()
26
    {
27
        return $this->getFactory()->createPaymentBraintreeQuery();
28
    }
29
30
    /**
31
     * @api
32
     *
33
     * @param int $idPayment
34
     *
35
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeQuery
36
     */
37
    public function queryPaymentById($idPayment)
38
    {
39
        return $this
40
            ->queryPayments()
41
            ->filterByIdPaymentBraintree($idPayment);
42
    }
43
44
    /**
45
     * @api
46
     *
47
     * @param int $idSalesOrder
48
     *
49
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeQuery
50
     */
51
    public function queryPaymentBySalesOrderId($idSalesOrder)
52
    {
53
        return $this
54
            ->queryPayments()
55
            ->filterByFkSalesOrder($idSalesOrder);
56
    }
57
58
    /**
59
     * @api
60
     *
61
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLogQuery
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Braintree\Persis...ansactionStatusLogQuery 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...
62
     */
63
    public function queryTransactionStatusLog()
64
    {
65
        return $this->getFactory()->createPaymentBraintreeTransactionStatusLogQuery();
66
    }
67
68
    /**
69
     * @api
70
     *
71
     * @param int $idPayment
72
     *
73
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLogQuery
74
     */
75
    public function queryTransactionStatusLogByPaymentId($idPayment)
76
    {
77
        return $this
78
            ->queryTransactionStatusLog()
79
            ->filterByFkPaymentBraintree($idPayment);
80
    }
81
82
    /**
83
     * @api
84
     *
85
     * @param int $idPayment
86
     *
87
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLogQuery
88
     */
89
    public function queryTransactionStatusLogByPaymentIdLatestFirst($idPayment)
90
    {
91
        return $this
92
            ->queryTransactionStatusLogByPaymentId($idPayment)
93
            ->orderByIdPaymentBraintreeTransactionStatusLog(Criteria::DESC);
0 ignored issues
show
Bug introduced by
The type SprykerEco\Zed\Braintree\Persistence\Criteria 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...
94
    }
95
96
    /**
97
     * @api
98
     *
99
     * @param int $idSalesOrder
100
     *
101
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLogQuery
102
     */
103
    public function queryTransactionStatusLogBySalesOrderId($idSalesOrder)
104
    {
105
        return $this
106
            ->queryTransactionStatusLog()
107
            ->useSpyPaymentBraintreeQuery()
108
                ->filterByFkSalesOrder($idSalesOrder)
109
            ->endUse();
110
    }
111
112
    /**
113
     * @api
114
     *
115
     * @param int $idSalesOrder
116
     *
117
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLogQuery
118
     */
119
    public function queryTransactionStatusLogBySalesOrderIdLatestFirst($idSalesOrder)
120
    {
121
        return $this
122
            ->queryTransactionStatusLogBySalesOrderId($idSalesOrder)
123
            ->orderByIdPaymentBraintreeTransactionStatusLog(Criteria::DESC);
124
    }
125
126
    /**
127
     * @api
128
     *
129
     * @param int $idSalesOrder
130
     * @param string $transactionCode
131
     *
132
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLogQuery
133
     */
134
    public function queryTransactionStatusLogBySalesOrderIdAndTransactionCodeLatestFirst($idSalesOrder, $transactionCode)
135
    {
136
        return $this->queryTransactionStatusLogBySalesOrderIdLatestFirst($idSalesOrder)
137
            ->withColumn(SpyPaymentBraintreeTransactionRequestLogTableMap::COL_TRANSACTION_CODE)
138
            ->addJoin(
139
                [
140
                    SpyPaymentBraintreeTransactionStatusLogTableMap::COL_TRANSACTION_ID,
141
                    SpyPaymentBraintreeTransactionRequestLogTableMap::COL_TRANSACTION_CODE,
142
                ],
143
                [
144
                    SpyPaymentBraintreeTransactionRequestLogTableMap::COL_TRANSACTION_ID,
145
                    Propel::getConnection()->quote($transactionCode),
146
                ]
147
            );
148
    }
149
150
    /**
151
     * @api
152
     *
153
     * @param int $idPayment
154
     *
155
     * @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionRequestLogQuery
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Braintree\Persis...nsactionRequestLogQuery 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...
156
     */
157
    public function queryTransactionRequestLogByPaymentId($idPayment)
158
    {
159
        $query = $this->getFactory()->createPaymentBraintreeTransactionRequestLogQuery();
160
161
        return $query->filterByFkPaymentBraintree($idPayment);
162
    }
163
}
164