Completed
Push — master ( a54a4b...bbfdca )
by Adam
15:54
created

PaymentMethod   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 127
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
wmc 16
lcom 0
cbo 8
dl 0
loc 127
rs 10
c 0
b 0
f 0

16 Methods

Rating   Name   Duplication   Size   Complexity  
A setProcessor() 0 4 1
A __construct() 0 6 1
A getProcessor() 0 4 1
A getShippingMethods() 0 4 1
A setShippingMethods() 0 4 1
A getConfiguration() 0 4 1
A setConfiguration() 0 4 1
A getClientGroups() 0 4 1
A setClientGroups() 0 4 1
A getPaymentPendingOrderStatus() 0 4 1
A setPaymentPendingOrderStatus() 0 4 1
A getPaymentSuccessOrderStatus() 0 4 1
A setPaymentSuccessOrderStatus() 0 4 1
A getPaymentFailureOrderStatus() 0 4 1
A setPaymentFailureOrderStatus() 0 4 1
A translate() 0 4 1
1
<?php
2
/*
3
 * WellCommerce Open-Source E-Commerce Platform
4
 *
5
 * This file is part of the WellCommerce package.
6
 *
7
 * (c) Adam Piotrowski <[email protected]>
8
 *
9
 * For the full copyright and license information,
10
 * please view the LICENSE file that was distributed with this source code.
11
 */
12
13
namespace WellCommerce\Bundle\OrderBundle\Entity;
14
15
use Doctrine\Common\Collections\ArrayCollection;
16
use Doctrine\Common\Collections\Collection;
17
use Knp\DoctrineBehaviors\Model\Blameable\Blameable;
18
use Knp\DoctrineBehaviors\Model\Timestampable\Timestampable;
19
use Knp\DoctrineBehaviors\Model\Translatable\Translatable;
20
use WellCommerce\Bundle\AppBundle\Entity\ShopCollectionAwareTrait;
21
use WellCommerce\Bundle\CoreBundle\Doctrine\Behaviours\Enableable;
22
use WellCommerce\Bundle\CoreBundle\Doctrine\Behaviours\Identifiable;
23
use WellCommerce\Bundle\CoreBundle\Doctrine\Behaviours\Sortable;
24
use WellCommerce\Bundle\CoreBundle\Entity\EntityInterface;
25
26
/**
27
 * Class PaymentMethod
28
 *
29
 * @author  Adam Piotrowski <[email protected]>
30
 */
31
class PaymentMethod implements EntityInterface
32
{
33
    use Identifiable;
34
    use Enableable;
35
    use Sortable;
36
    use Translatable;
37
    use Timestampable;
38
    use Blameable;
39
    use ShopCollectionAwareTrait;
40
    
41
    /**
42
     * @var string
43
     */
44
    protected $processor = '';
45
    
46
    /**
47
     * @var array
48
     */
49
    protected $configuration = [];
50
    
51
    /**
52
     * @var OrderStatus
53
     */
54
    protected $paymentPendingOrderStatus;
55
    
56
    /**
57
     * @var OrderStatus
58
     */
59
    protected $paymentSuccessOrderStatus;
60
    
61
    /**
62
     * @var OrderStatus
63
     */
64
    protected $paymentFailureOrderStatus;
65
    
66
    /**
67
     * @var Collection
68
     */
69
    protected $shippingMethods;
70
    
71
    /**
72
     * @var Collection
73
     */
74
    protected $clientGroups;
75
    
76
    public function __construct()
77
    {
78
        $this->shippingMethods = new ArrayCollection();
79
        $this->shops           = new ArrayCollection();
80
        $this->clientGroups    = new ArrayCollection();
81
    }
82
    
83
    public function getProcessor(): string
84
    {
85
        return $this->processor;
86
    }
87
    
88
    public function setProcessor(string $processor)
89
    {
90
        $this->processor = $processor;
91
    }
92
    
93
    public function getShippingMethods(): Collection
94
    {
95
        return $this->shippingMethods;
96
    }
97
    
98
    public function setShippingMethods(Collection $shippingMethods)
99
    {
100
        $this->shippingMethods = $shippingMethods;
101
    }
102
    
103
    public function getConfiguration(): array
104
    {
105
        return $this->configuration;
106
    }
107
    
108
    public function setConfiguration(array $configuration)
109
    {
110
        $this->configuration = $configuration;
111
    }
112
    
113
    public function getClientGroups(): Collection
114
    {
115
        return $this->clientGroups;
116
    }
117
    
118
    public function setClientGroups(Collection $clientGroups)
119
    {
120
        $this->clientGroups = $clientGroups;
121
    }
122
    
123
    public function getPaymentPendingOrderStatus()
124
    {
125
        return $this->paymentPendingOrderStatus;
126
    }
127
    
128
    public function setPaymentPendingOrderStatus(OrderStatus $paymentPendingOrderStatus)
129
    {
130
        $this->paymentPendingOrderStatus = $paymentPendingOrderStatus;
131
    }
132
    
133
    public function getPaymentSuccessOrderStatus()
134
    {
135
        return $this->paymentSuccessOrderStatus;
136
    }
137
    
138
    public function setPaymentSuccessOrderStatus(OrderStatus $paymentSuccessOrderStatus)
139
    {
140
        $this->paymentSuccessOrderStatus = $paymentSuccessOrderStatus;
141
    }
142
    
143
    public function getPaymentFailureOrderStatus()
144
    {
145
        return $this->paymentFailureOrderStatus;
146
    }
147
    
148
    public function setPaymentFailureOrderStatus(OrderStatus $paymentFailureOrderStatus)
149
    {
150
        $this->paymentFailureOrderStatus = $paymentFailureOrderStatus;
151
    }
152
    
153
    public function translate($locale = null, $fallbackToDefault = true): PaymentMethodTranslation
154
    {
155
        return $this->doTranslate($locale, $fallbackToDefault);
156
    }
157
}
158