1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Entité UnitStorage. |
5
|
|
|
* |
6
|
|
|
* PHP Version 5 |
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 0.1.0 |
13
|
|
|
* |
14
|
|
|
* @link https://github.com/Dev-Int/glsr |
15
|
|
|
*/ |
16
|
|
|
namespace AppBundle\Entity; |
17
|
|
|
|
18
|
|
|
use Doctrine\ORM\Mapping as ORM; |
19
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* UnitStorage Entité UnitStorage. |
23
|
|
|
* |
24
|
|
|
* PHP Version 5 |
25
|
|
|
* |
26
|
|
|
* @category Entity |
27
|
|
|
* |
28
|
|
|
* @ORM\Table(name="gs_unitstorage") |
29
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Entity\UnitStorageRepository") |
30
|
|
|
*/ |
31
|
|
|
class UnitStorage |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* @var int Id de l'unité de stockage |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="id", type="integer") |
37
|
|
|
* @ORM\Id |
38
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
39
|
|
|
*/ |
40
|
|
|
private $id; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string Nom de l'unité de stockage |
44
|
|
|
* |
45
|
|
|
* @ORM\Column(name="name", type="string", length=255) |
46
|
|
|
*/ |
47
|
|
|
private $name; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var string Abbréviation de l'unité de stockage |
51
|
|
|
* |
52
|
|
|
* @ORM\Column(name="abbr", type="string", length=50) |
53
|
|
|
*/ |
54
|
|
|
private $abbr; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var string Slug name |
58
|
|
|
* @Gedmo\Slug(fields={"name"}) |
59
|
|
|
* @ORM\Column(length=128, unique=true) |
60
|
|
|
*/ |
61
|
|
|
private $slug; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Get id. |
65
|
|
|
* |
66
|
|
|
* @return int |
67
|
|
|
*/ |
68
|
|
|
public function getId() |
69
|
|
|
{ |
70
|
|
|
return $this->id; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Set name. |
75
|
|
|
* |
76
|
|
|
* @param string $name Nom de l'unité de stockage |
77
|
|
|
* |
78
|
|
|
* @return UnitStorage |
79
|
|
|
*/ |
80
|
|
|
public function setName($name) |
81
|
|
|
{ |
82
|
|
|
$this->name = $name; |
83
|
|
|
|
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Get name. |
89
|
|
|
* |
90
|
|
|
* @return string |
91
|
|
|
*/ |
92
|
|
|
public function getName() |
93
|
|
|
{ |
94
|
|
|
return $this->name; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Set abbr. |
99
|
|
|
* |
100
|
|
|
* @param string $abbr Abbréviation de l'unité de stockage |
101
|
|
|
* |
102
|
|
|
* @return UnitStorage |
103
|
|
|
*/ |
104
|
|
|
public function setAbbr($abbr) |
105
|
|
|
{ |
106
|
|
|
$this->abbr = $abbr; |
107
|
|
|
|
108
|
|
|
return $this; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* Get abbr. |
113
|
|
|
* |
114
|
|
|
* @return string |
115
|
|
|
*/ |
116
|
|
|
public function getAbbr() |
117
|
|
|
{ |
118
|
|
|
return $this->abbr; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* Cette méthode permet de faire "echo $unitStorage". |
123
|
|
|
* <p>Ainsi, pour "afficher" $unitStorage, |
124
|
|
|
* PHP affichera en réalité le retour de cette méthode.<br /> |
125
|
|
|
* Ici, le nom, donc "echo $unitStorage" |
126
|
|
|
* est équivalent à "echo $unitStorage->getName()"</p>. |
127
|
|
|
* |
128
|
|
|
* @return string name |
129
|
|
|
*/ |
130
|
|
|
public function __toString() |
131
|
|
|
{ |
132
|
|
|
return $this->abbr; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Set slug |
137
|
|
|
* |
138
|
|
|
* @param string $slug |
139
|
|
|
* @return UnitStorage |
140
|
|
|
*/ |
141
|
|
|
public function setSlug($slug) |
142
|
|
|
{ |
143
|
|
|
$this->slug = $slug; |
144
|
|
|
|
145
|
|
|
return $this; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* Get slug |
150
|
|
|
* |
151
|
|
|
* @return string |
152
|
|
|
*/ |
153
|
|
|
public function getSlug() |
154
|
|
|
{ |
155
|
|
|
return $this->slug; |
156
|
|
|
} |
157
|
|
|
} |
158
|
|
|
|