Completed
Branch master (fdcd72)
by Laurent
03:58
created

Inventory::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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 integer
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
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\InventoryArticles", mappedBy="inventory")
71
     * @ORM\JoinColumn(nullable=false)
72
     */
73
    private $articles;
74
75
    public function __construct()
76
    {
77
        $this->articles = new ArrayCollection();
78
        $this->date = new \DateTime();
79
        $this->amount = 0.000;
80
        $this->status = 1;
81
    }
82
83
    /**
84
     * Get id
85
     *
86
     * @return integer
87
     */
88
    public function getId()
89
    {
90
        return $this->id;
91
    }
92
93
    /**
94
     * Set date
95
     *
96
     * @param \DateTime $date
97
     * @return Inventory
98
     */
99
    public function setDate($date)
100
    {
101
        $this->date = $date;
102
103
        return $this;
104
    }
105
106
    /**
107
     * Get date
108
     *
109
     * @return \DateTime
110
     */
111
    public function getDate()
112
    {
113
        return $this->date;
114
    }
115
116
    /**
117
     * Set file
118
     *
119
     * @param string $file
120
     * @return Inventory
121
     */
122
    public function setFile($file)
123
    {
124
        $this->file = $file;
125
126
        return $this;
127
    }
128
129
    /**
130
     * Get file
131
     *
132
     * @return string
133
     */
134
    public function getFile()
135
    {
136
        return $this->file;
137
    }
138
139
    /**
140
     * Set amount
141
     *
142
     * @param float $amount
143
     * @return Inventory
144
     */
145
    public function setAmount($amount)
146
    {
147
        $this->amount = $amount;
148
149
        return $this;
150
    }
151
152
    /**
153
     * Get amount
154
     *
155
     * @return string
156
     */
157
    public function getAmount()
158
    {
159
        return $this->amount;
160
    }
161
162
    /**
163
     * Set status
164
     *
165
     * @param integer $status
166
     * @return Inventory
167
     */
168
    public function setStatus($status)
169
    {
170
        $this->status = $status;
171
172
        return $this;
173
    }
174
175
    /**
176
     * Get status
177
     *
178
     * @return integer
179
     */
180
    public function getStatus()
181
    {
182
        return $this->status;
183
    }
184
185
    /**
186
     * Add articles
187
     *
188
     * @param \AppBundle\Entity\InventoryArticles $articles
189
     * @return Inventory
190
     */
191
    public function addArticle(InventoryArticles $articles)
192
    {
193
        $this->articles[] = $articles;
194
195
        return $this;
196
    }
197
198
    /**
199
     * Remove articles
200
     *
201
     * @param \AppBundle\Entity\InventoryArticles $articles
202
     */
203
    public function removeArticle(InventoryArticles $articles)
204
    {
205
        $this->articles->removeElement($articles);
206
    }
207
208
    /**
209
     * Get articles
210
     *
211
     * @return \Doctrine\Common\Collections\Collection
212
     */
213
    public function getArticles()
214
    {
215
        return $this->articles;
216
    }
217
}
218