1 | <?php |
||
31 | class Material |
||
32 | { |
||
33 | /** |
||
34 | * @var int |
||
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 |
||
44 | * |
||
45 | * @ORM\Column(name="name", type="string", unique=true) |
||
46 | */ |
||
47 | private $name; |
||
48 | |||
49 | /** |
||
50 | * @var string|\AppBundle\Entity\UnitStorage Unité de stockage |
||
51 | * |
||
52 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\UnitStorage") |
||
53 | */ |
||
54 | private $unitStorage; |
||
55 | |||
56 | /** |
||
57 | * @var bool |
||
58 | * |
||
59 | * @ORM\Column(name="active", type="boolean") |
||
60 | */ |
||
61 | private $active; |
||
62 | |||
63 | /** |
||
64 | * @var bool |
||
65 | * |
||
66 | * @ORM\Column(name="multiple", type="boolean") |
||
67 | */ |
||
68 | private $multiple; |
||
69 | |||
70 | /** |
||
71 | * @var \Doctrine\Common\Collections\ArrayCollection Article(s) |
||
72 | * |
||
73 | * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Article") |
||
74 | * @ORM\JoinTable(name="gs_material_article") |
||
75 | * @Assert\NotBlank() |
||
76 | */ |
||
77 | private $articles; |
||
78 | |||
79 | /** |
||
80 | * @Gedmo\Slug(fields={"name"}, updatable=false) |
||
81 | * @ORM\Column(length=128, unique=true) |
||
82 | */ |
||
83 | private $slug; |
||
84 | |||
85 | |||
86 | /** |
||
87 | * Constructor. |
||
88 | */ |
||
89 | public function __construct() |
||
93 | |||
94 | /** |
||
95 | * Get id |
||
96 | * |
||
97 | * @return integer |
||
98 | */ |
||
99 | public function getId() |
||
103 | |||
104 | /** |
||
105 | * Set name |
||
106 | * |
||
107 | * @param string $name |
||
108 | * @return Material |
||
109 | */ |
||
110 | public function setName($name) |
||
116 | |||
117 | /** |
||
118 | * Get name |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | public function getName() |
||
126 | |||
127 | /** |
||
128 | * Set active |
||
129 | * |
||
130 | * @param boolean $active |
||
131 | * @return Material |
||
132 | */ |
||
133 | public function setActive($active) |
||
139 | |||
140 | /** |
||
141 | * Get active |
||
142 | * |
||
143 | * @return boolean |
||
144 | */ |
||
145 | public function isActive() |
||
149 | |||
150 | /** |
||
151 | * Set multiple |
||
152 | * |
||
153 | * @param boolean $multiple |
||
154 | * @return Material |
||
155 | */ |
||
156 | public function setMultiple($multiple) |
||
162 | |||
163 | /** |
||
164 | * Get multiple |
||
165 | * |
||
166 | * @return boolean |
||
167 | */ |
||
168 | public function isMultiple() |
||
172 | |||
173 | /** |
||
174 | * Set unitStorage |
||
175 | * |
||
176 | * @param \AppBundle\Entity\UnitStorage $unitStorage |
||
177 | * @return Material |
||
178 | */ |
||
179 | public function setUnitStorage(UnitStorage $unitStorage = null) |
||
185 | |||
186 | /** |
||
187 | * Get unitStorage |
||
188 | * |
||
189 | * @return \AppBundle\Entity\UnitStorage |
||
190 | */ |
||
191 | public function getUnitStorage() |
||
195 | |||
196 | /** |
||
197 | * Add articles |
||
198 | * |
||
199 | * @param \AppBundle\Entity\Article $articles |
||
200 | * @return Material |
||
201 | */ |
||
202 | public function addArticle(Article $articles) |
||
208 | |||
209 | /** |
||
210 | * Remove articles |
||
211 | * |
||
212 | * @param \AppBundle\Entity\Article $articles |
||
213 | */ |
||
214 | public function removeArticle(Article $articles) |
||
218 | |||
219 | /** |
||
220 | * Get articles |
||
221 | * |
||
222 | * @return \Doctrine\Common\Collections\Collection |
||
223 | */ |
||
224 | public function getArticles() |
||
228 | |||
229 | /** |
||
230 | * Get slug |
||
231 | * |
||
232 | * @return string |
||
233 | */ |
||
234 | public function getSlug() |
||
238 | } |
||
239 |