1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Entity OrdersArticles. |
5
|
|
|
* |
6
|
|
|
* PHP Version 7 |
7
|
|
|
* |
8
|
|
|
* @author Quétier Laurent <[email protected]> |
9
|
|
|
* @copyright 2014 Dev-Int GLSR |
10
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License |
11
|
|
|
* |
12
|
|
|
* @version GIT: <git_id> |
13
|
|
|
* |
14
|
|
|
* @link https://github.com/Dev-Int/glsr |
15
|
|
|
*/ |
16
|
|
|
namespace App\Entity\Orders; |
17
|
|
|
|
18
|
|
|
use Doctrine\ORM\Mapping as ORM; |
19
|
|
|
use App\Entity\Orders\Orders; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* OrdersArticles entity. |
23
|
|
|
* |
24
|
|
|
* @ORM\Table(name="gs_orders_articles") |
25
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\Orders\OrdersArticlesRepository") |
26
|
|
|
*/ |
27
|
|
|
class OrdersArticles |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* @var integer $artId |
31
|
|
|
* |
32
|
|
|
* @ORM\Column(name="id", type="integer") |
33
|
|
|
* @ORM\Id |
34
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
35
|
|
|
*/ |
36
|
|
|
private $artId; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var Orders $orders |
40
|
|
|
* |
41
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Orders\Orders", inversedBy="articles") |
42
|
|
|
* @ORM\JoinColumn(nullable=false) |
43
|
|
|
*/ |
44
|
|
|
private $orders; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var Article $articles |
48
|
|
|
* |
49
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Settings\Article") |
50
|
|
|
* @ORM\JoinColumn(nullable=false) |
51
|
|
|
*/ |
52
|
|
|
private $article; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var string $quantity Quantity for the order |
56
|
|
|
* |
57
|
|
|
* @ORM\Column(name="quantity", type="decimal", precision=7, scale=3) |
58
|
|
|
*/ |
59
|
|
|
private $quantity; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var string|\App\Entity\Settings\Diverse\Unit $unitStorage Storage unit |
63
|
|
|
* |
64
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\Unit") |
65
|
|
|
* @ORM\JoinColumn(nullable=false) |
66
|
|
|
*/ |
67
|
|
|
private $unitStorage; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string $price Price of article |
71
|
|
|
* |
72
|
|
|
* @ORM\Column(name="price", type="decimal", precision=7, scale=3, nullable=true) |
73
|
|
|
*/ |
74
|
|
|
private $price; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @var string|\App\Entity\Settings\Diverse\Tva $tva Rate of VAT |
78
|
|
|
* |
79
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\Tva") |
80
|
|
|
* @ORM\JoinColumn(nullable=false) |
81
|
|
|
*/ |
82
|
|
|
private $tva; |
83
|
|
|
|
84
|
|
|
|
85
|
|
|
public function __construct() |
86
|
|
|
{ |
87
|
|
|
$this->quantity = 0.000; |
|
|
|
|
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Get id |
92
|
|
|
* |
93
|
|
|
* @return integer |
94
|
|
|
*/ |
95
|
|
|
public function getId() |
96
|
|
|
{ |
97
|
|
|
return $this->artId; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Set quantity |
102
|
|
|
* |
103
|
|
|
* @param string $quantity |
104
|
|
|
* @return OrdersArticles |
105
|
|
|
*/ |
106
|
|
|
public function setQuantity($quantity) |
107
|
|
|
{ |
108
|
|
|
$this->quantity = $quantity; |
109
|
|
|
|
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Get quantity |
115
|
|
|
* |
116
|
|
|
* @return string |
117
|
|
|
*/ |
118
|
|
|
public function getQuantity() |
119
|
|
|
{ |
120
|
|
|
return $this->quantity; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Set price |
125
|
|
|
* |
126
|
|
|
* @param string $price |
127
|
|
|
* @return OrdersArticles |
128
|
|
|
*/ |
129
|
|
|
public function setPrice($price) |
130
|
|
|
{ |
131
|
|
|
$this->price = $price; |
132
|
|
|
|
133
|
|
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Get price |
138
|
|
|
* |
139
|
|
|
* @return string |
140
|
|
|
*/ |
141
|
|
|
public function getPrice() |
142
|
|
|
{ |
143
|
|
|
return $this->price; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* Set orders |
148
|
|
|
* |
149
|
|
|
* @param \App\Entity\Orders\Orders $orders |
150
|
|
|
* @return OrdersArticles |
151
|
|
|
*/ |
152
|
|
|
public function setOrders(Orders $orders) |
153
|
|
|
{ |
154
|
|
|
$this->orders = $orders; |
155
|
|
|
|
156
|
|
|
return $this; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Get orders |
161
|
|
|
* |
162
|
|
|
* @return \App\Entity\Orders\Orders |
163
|
|
|
*/ |
164
|
|
|
public function getOrders() |
165
|
|
|
{ |
166
|
|
|
return $this->orders; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Set article |
171
|
|
|
* |
172
|
|
|
* @param \App\Entity\Settings\Article $article |
173
|
|
|
* @return OrdersArticles |
174
|
|
|
*/ |
175
|
|
|
public function setArticle(\App\Entity\Settings\Article $article) |
176
|
|
|
{ |
177
|
|
|
$this->article = $article; |
|
|
|
|
178
|
|
|
|
179
|
|
|
return $this; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* Get article |
184
|
|
|
* |
185
|
|
|
* @return \App\Entity\Settings\Article |
186
|
|
|
*/ |
187
|
|
|
public function getArticle() |
188
|
|
|
{ |
189
|
|
|
return $this->article; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* Set unitStorage |
194
|
|
|
* |
195
|
|
|
* @param \App\Entity\Settings\Diverse\Unit $unitStorage |
196
|
|
|
* @return OrdersArticles |
197
|
|
|
*/ |
198
|
|
|
public function setUnitStorage(\App\Entity\Settings\Diverse\Unit $unitStorage) |
199
|
|
|
{ |
200
|
|
|
$this->unitStorage = $unitStorage; |
201
|
|
|
|
202
|
|
|
return $this; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* Get unitStorage |
207
|
|
|
* |
208
|
|
|
* @return \App\Entity\Settings\Diverse\Unit |
209
|
|
|
*/ |
210
|
|
|
public function getUnitStorage() |
211
|
|
|
{ |
212
|
|
|
return $this->unitStorage; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* Set tva |
217
|
|
|
* |
218
|
|
|
* @param \App\Entity\Settings\Diverse\Tva $tva |
219
|
|
|
* @return OrdersArticles |
220
|
|
|
*/ |
221
|
|
|
public function setTva(\App\Entity\Settings\Diverse\Tva $tva) |
222
|
|
|
{ |
223
|
|
|
$this->tva = $tva; |
224
|
|
|
|
225
|
|
|
return $this; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* Get tva |
230
|
|
|
* |
231
|
|
|
* @return \App\Entity\Settings\Diverse\Tva |
232
|
|
|
*/ |
233
|
|
|
public function getTva() |
234
|
|
|
{ |
235
|
|
|
return $this->tva; |
236
|
|
|
} |
237
|
|
|
} |
238
|
|
|
|
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.