|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Entité Inventory. |
|
4
|
|
|
* |
|
5
|
|
|
* PHP Version 5 |
|
6
|
|
|
* |
|
7
|
|
|
* @author Quétier Laurent <[email protected]> |
|
8
|
|
|
* @copyright 2014 Dev-Int GLSR |
|
9
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|
10
|
|
|
* |
|
11
|
|
|
* @version since 1.0.0 |
|
12
|
|
|
* |
|
13
|
|
|
* @link https://github.com/Dev-Int/glsr |
|
14
|
|
|
*/ |
|
15
|
|
|
namespace AppBundle\Entity; |
|
16
|
|
|
|
|
17
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
18
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
19
|
|
|
use AppBundle\Entity\InventoryArticles; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Inventory |
|
23
|
|
|
* |
|
24
|
|
|
* @category Entity |
|
25
|
|
|
* |
|
26
|
|
|
* @ORM\Table(name="gs_inventory") |
|
27
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Entity\InventoryRepository") |
|
28
|
|
|
*/ |
|
29
|
|
|
class Inventory |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* @var integer |
|
33
|
|
|
* |
|
34
|
|
|
* @ORM\Column(name="id", type="integer") |
|
35
|
|
|
* @ORM\Id |
|
36
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
37
|
|
|
*/ |
|
38
|
|
|
private $id; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var \DateTime |
|
42
|
|
|
* |
|
43
|
|
|
* @ORM\Column(name="date", type="datetime") |
|
44
|
|
|
*/ |
|
45
|
|
|
private $date; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @var boolean |
|
49
|
|
|
* |
|
50
|
|
|
* @ORM\Column(name="status", type="smallint") |
|
51
|
|
|
*/ |
|
52
|
|
|
private $status; |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @var float Montant de l'inventaire |
|
57
|
|
|
* |
|
58
|
|
|
* @ORM\Column(name="amount", type="decimal", precision=7, scale=3, nullable=true) |
|
59
|
|
|
*/ |
|
60
|
|
|
private $amount; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @var string |
|
64
|
|
|
* |
|
65
|
|
|
* @ORM\Column(name="file", type="text", nullable=true) |
|
66
|
|
|
*/ |
|
67
|
|
|
private $file; |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @var string |
|
71
|
|
|
* |
|
72
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\InventoryArticles", mappedBy="inventory") |
|
73
|
|
|
* @ORM\JoinColumn(nullable=false) |
|
74
|
|
|
*/ |
|
75
|
|
|
private $articles; |
|
76
|
|
|
|
|
77
|
|
|
public function __construct() |
|
78
|
|
|
{ |
|
79
|
|
|
$this->articles = new ArrayCollection(); |
|
|
|
|
|
|
80
|
|
|
$this->date = new \DateTime(); |
|
81
|
|
|
$this->amount = 0.000; |
|
82
|
|
|
$this->status = 1; |
|
|
|
|
|
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* Get id |
|
87
|
|
|
* |
|
88
|
|
|
* @return integer |
|
89
|
|
|
*/ |
|
90
|
|
|
public function getId() |
|
91
|
|
|
{ |
|
92
|
|
|
return $this->id; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* Set date |
|
97
|
|
|
* |
|
98
|
|
|
* @param \DateTime $date |
|
99
|
|
|
* @return Inventory |
|
100
|
|
|
*/ |
|
101
|
|
|
public function setDate($date) |
|
102
|
|
|
{ |
|
103
|
|
|
$this->date = $date; |
|
104
|
|
|
|
|
105
|
|
|
return $this; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* Get date |
|
110
|
|
|
* |
|
111
|
|
|
* @return \DateTime |
|
112
|
|
|
*/ |
|
113
|
|
|
public function getDate() |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->date; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
/** |
|
119
|
|
|
* Set file |
|
120
|
|
|
* |
|
121
|
|
|
* @param string $file |
|
122
|
|
|
* @return Inventory |
|
123
|
|
|
*/ |
|
124
|
|
|
public function setFile($file) |
|
125
|
|
|
{ |
|
126
|
|
|
$this->file = $file; |
|
127
|
|
|
|
|
128
|
|
|
return $this; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* Get file |
|
133
|
|
|
* |
|
134
|
|
|
* @return string |
|
135
|
|
|
*/ |
|
136
|
|
|
public function getFile() |
|
137
|
|
|
{ |
|
138
|
|
|
return $this->file; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* Set amount |
|
143
|
|
|
* |
|
144
|
|
|
* @param string $amount |
|
145
|
|
|
* @return Inventory |
|
146
|
|
|
*/ |
|
147
|
|
|
public function setAmount($amount) |
|
148
|
|
|
{ |
|
149
|
|
|
$this->amount = $amount; |
|
|
|
|
|
|
150
|
|
|
|
|
151
|
|
|
return $this; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* Get amount |
|
156
|
|
|
* |
|
157
|
|
|
* @return string |
|
158
|
|
|
*/ |
|
159
|
|
|
public function getAmount() |
|
160
|
|
|
{ |
|
161
|
|
|
return $this->amount; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* Set status |
|
166
|
|
|
* |
|
167
|
|
|
* @param integer $status |
|
168
|
|
|
* @return Inventory |
|
169
|
|
|
*/ |
|
170
|
|
|
public function setStatus($status) |
|
171
|
|
|
{ |
|
172
|
|
|
$this->status = $status; |
|
|
|
|
|
|
173
|
|
|
|
|
174
|
|
|
return $this; |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
/** |
|
178
|
|
|
* Get status |
|
179
|
|
|
* |
|
180
|
|
|
* @return integer |
|
181
|
|
|
*/ |
|
182
|
|
|
public function getStatus() |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->status; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
/** |
|
188
|
|
|
* Add articles |
|
189
|
|
|
* |
|
190
|
|
|
* @param \AppBundle\Entity\InventoryArticles $articles |
|
191
|
|
|
* @return Inventory |
|
192
|
|
|
*/ |
|
193
|
|
|
public function addArticle(InventoryArticles $articles) |
|
194
|
|
|
{ |
|
195
|
|
|
$this->articles[] = $articles; |
|
196
|
|
|
|
|
197
|
|
|
return $this; |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
/** |
|
201
|
|
|
* Remove articles |
|
202
|
|
|
* |
|
203
|
|
|
* @param \AppBundle\Entity\InventoryArticles $articles |
|
204
|
|
|
*/ |
|
205
|
|
|
public function removeArticle(InventoryArticles $articles) |
|
206
|
|
|
{ |
|
207
|
|
|
$this->articles->removeElement($articles); |
|
|
|
|
|
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
/** |
|
211
|
|
|
* Get articles |
|
212
|
|
|
* |
|
213
|
|
|
* @return \Doctrine\Common\Collections\Collection |
|
214
|
|
|
*/ |
|
215
|
|
|
public function getArticles() |
|
216
|
|
|
{ |
|
217
|
|
|
return $this->articles; |
|
218
|
|
|
} |
|
219
|
|
|
} |
|
220
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..