BraintreeQueryContainer   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 144
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 32
c 1
b 0
f 0
dl 0
loc 144
rs 10
wmc 10

10 Methods

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