1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Loevgaard\DandomainFoundation\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\PaymentMethodInterface; |
|
|
|
|
7
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\PaymentMethodTrait; |
|
|
|
|
8
|
|
|
use Money\Currency; |
9
|
|
|
use Money\Money; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @ORM\Entity() |
13
|
|
|
* @ORM\Table(name="ldf_payment_methods") |
14
|
|
|
*/ |
15
|
|
|
class PaymentMethod extends AbstractEntity implements PaymentMethodInterface |
16
|
|
|
{ |
17
|
|
|
use PaymentMethodTrait; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var int |
21
|
|
|
* |
22
|
|
|
* @ORM\Id |
23
|
|
|
* @ORM\GeneratedValue |
24
|
|
|
* @ORM\Column(type="integer") |
25
|
|
|
**/ |
26
|
|
|
protected $id; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var int |
30
|
|
|
* |
31
|
|
|
* @ORM\Column(type="integer", unique=true) |
32
|
|
|
*/ |
33
|
|
|
protected $externalId; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var string|null |
37
|
|
|
* |
38
|
|
|
* @ORM\Column(nullable=true, type="string", length=3) |
39
|
|
|
*/ |
40
|
|
|
protected $feeCurrency; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var integer|null |
44
|
|
|
* |
45
|
|
|
* @ORM\Column(nullable=true, type="integer") |
46
|
|
|
*/ |
47
|
|
|
protected $feeAmount; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var bool|null |
51
|
|
|
* |
52
|
|
|
* @ORM\Column(nullable=true, type="boolean") |
53
|
|
|
*/ |
54
|
|
|
protected $feeInclVat; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var string|null |
58
|
|
|
* |
59
|
|
|
* @ORM\Column(nullable=true, type="string", length=191) |
60
|
|
|
*/ |
61
|
|
|
protected $name; |
62
|
|
|
|
63
|
|
|
public function __toString() |
64
|
|
|
{ |
65
|
|
|
return (string)$this->name; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return int |
70
|
|
|
*/ |
71
|
|
|
public function getId(): int |
72
|
|
|
{ |
73
|
|
|
return (int)$this->id; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param int $id |
78
|
|
|
* @return PaymentMethodInterface |
79
|
|
|
*/ |
80
|
|
|
public function setId($id) |
81
|
|
|
{ |
82
|
|
|
$this->id = $id; |
83
|
|
|
return $this; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return int |
88
|
|
|
*/ |
89
|
|
|
public function getExternalId(): int |
90
|
|
|
{ |
91
|
|
|
return (int)$this->externalId; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param int $externalId |
96
|
|
|
* @return PaymentMethodInterface |
97
|
|
|
*/ |
98
|
|
|
public function setExternalId($externalId) |
99
|
|
|
{ |
100
|
|
|
$this->externalId = $externalId; |
101
|
|
|
return $this; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @return Money|null |
106
|
|
|
*/ |
107
|
|
|
public function getFee() : ?Money |
108
|
|
|
{ |
109
|
|
|
if (!$this->feeCurrency) { |
|
|
|
|
110
|
|
|
return null; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
return new Money($this->feeAmount, new Currency($this->feeCurrency)); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param Money $money |
118
|
|
|
* @return PaymentMethodInterface |
119
|
|
|
*/ |
120
|
|
|
public function setFee(Money $money) : PaymentMethodInterface |
121
|
|
|
{ |
122
|
|
|
$this->feeAmount = $money->getAmount(); |
|
|
|
|
123
|
|
|
$this->feeCurrency = $money->getCurrency()->getCode(); |
124
|
|
|
|
125
|
|
|
return $this; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return bool|null |
130
|
|
|
*/ |
131
|
|
|
public function getFeeInclVat() |
132
|
|
|
{ |
133
|
|
|
return $this->feeInclVat; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @param bool|null $feeInclVat |
138
|
|
|
* @return PaymentMethodInterface |
139
|
|
|
*/ |
140
|
|
|
public function setFeeInclVat($feeInclVat) |
141
|
|
|
{ |
142
|
|
|
$this->feeInclVat = $feeInclVat; |
143
|
|
|
return $this; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return null|string |
148
|
|
|
*/ |
149
|
|
|
public function getName() |
150
|
|
|
{ |
151
|
|
|
return $this->name; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @param null|string $name |
156
|
|
|
* @return PaymentMethodInterface |
157
|
|
|
*/ |
158
|
|
|
public function setName($name) |
159
|
|
|
{ |
160
|
|
|
$this->name = $name; |
161
|
|
|
return $this; |
162
|
|
|
} |
163
|
|
|
} |
164
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths