1 | <?php |
||
16 | class News |
||
17 | { |
||
18 | /** |
||
19 | * @ORM\Column(type="integer") |
||
20 | * @ORM\Id |
||
21 | * @ORM\GeneratedValue(strategy="AUTO") |
||
22 | */ |
||
23 | protected $id; |
||
24 | |||
25 | /** |
||
26 | * @ORM\Column(type="string", length=100) |
||
27 | */ |
||
28 | protected $title; |
||
29 | |||
30 | /** |
||
31 | * @ORM\Column(type="string", length=100, nullable=true) |
||
32 | */ |
||
33 | protected $subtitle; |
||
34 | |||
35 | /** |
||
36 | * @ORM\Column(type="date", nullable=true) |
||
37 | */ |
||
38 | protected $date; |
||
39 | |||
40 | /** |
||
41 | * @ORM\Column(type="boolean") |
||
42 | */ |
||
43 | protected $visible; |
||
44 | |||
45 | /** |
||
46 | * @ORM\Column(type="datetime", name="created_at") |
||
47 | */ |
||
48 | protected $createdAt; |
||
49 | |||
50 | /** |
||
51 | * @ORM\Column(type="text", name="creator_email") |
||
52 | */ |
||
53 | protected $creatorEmail; |
||
54 | |||
55 | /** |
||
56 | * @ORM\Column(length=255, nullable=true) |
||
57 | * @Uploadable\Uploadable(targetField="photo") |
||
58 | */ |
||
59 | protected $photoKey; |
||
60 | |||
61 | /** |
||
62 | * @var \FSi\DoctrineExtensions\Uploadable\File|\SplFileInfo |
||
63 | * @UploadableAssert\Image() |
||
64 | */ |
||
65 | protected $photo; |
||
66 | |||
67 | /** |
||
68 | * @var Category[]|Collection |
||
69 | * |
||
70 | * @ORM\ManyToMany(targetEntity="Category") |
||
71 | */ |
||
72 | protected $categories; |
||
73 | |||
74 | /** |
||
75 | * @var Tag[]|Collection |
||
76 | * |
||
77 | * @Assert\Valid |
||
78 | * @ORM\OneToMany(targetEntity="Tag", mappedBy="news", cascade={"persist"}, orphanRemoval=true) |
||
79 | */ |
||
80 | protected $tags; |
||
81 | |||
82 | public function __construct() |
||
87 | |||
88 | /** |
||
89 | * @return mixed |
||
90 | */ |
||
91 | public function getId() |
||
95 | |||
96 | /** |
||
97 | * @param mixed $id |
||
98 | * @return News |
||
99 | */ |
||
100 | public function setId($id) |
||
105 | |||
106 | /** |
||
107 | * @param mixed $createdAt |
||
108 | */ |
||
109 | public function setCreatedAt($createdAt) |
||
113 | |||
114 | /** |
||
115 | * @return mixed |
||
116 | */ |
||
117 | public function getCreatedAt() |
||
121 | |||
122 | /** |
||
123 | * @param mixed $creatorEmail |
||
124 | */ |
||
125 | public function setCreatorEmail($creatorEmail) |
||
129 | |||
130 | /** |
||
131 | * @return mixed |
||
132 | */ |
||
133 | public function getCreatorEmail() |
||
137 | |||
138 | /** |
||
139 | * @param mixed $title |
||
140 | */ |
||
141 | public function setTitle($title) |
||
145 | |||
146 | /** |
||
147 | * @return mixed |
||
148 | */ |
||
149 | public function getTitle() |
||
153 | |||
154 | /** |
||
155 | * @param mixed $subtitle |
||
156 | */ |
||
157 | public function setSubtitle($subtitle) |
||
161 | |||
162 | /** |
||
163 | * @return mixed |
||
164 | */ |
||
165 | public function getSubtitle() |
||
169 | |||
170 | /** |
||
171 | * @param mixed $date |
||
172 | */ |
||
173 | public function setDate($date) |
||
177 | |||
178 | /** |
||
179 | * @return mixed |
||
180 | */ |
||
181 | public function getDate() |
||
185 | |||
186 | /** |
||
187 | * @param mixed $visible |
||
188 | * @return News |
||
189 | */ |
||
190 | public function setVisible($visible) |
||
195 | |||
196 | /** |
||
197 | * @return mixed |
||
198 | */ |
||
199 | public function isVisible() |
||
203 | |||
204 | /** |
||
205 | * @return mixed |
||
206 | */ |
||
207 | public function getPhotoKey() |
||
211 | |||
212 | /** |
||
213 | * @param mixed $photoKey |
||
214 | */ |
||
215 | public function setPhotoKey($photoKey) |
||
219 | |||
220 | /** |
||
221 | * @return \FSi\DoctrineExtensions\Uploadable\File|\SplFileInfo |
||
222 | */ |
||
223 | public function getPhoto() |
||
227 | |||
228 | /** |
||
229 | * @param \FSi\DoctrineExtensions\Uploadable\File|\SplFileInfo $photo |
||
230 | */ |
||
231 | public function setPhoto($photo) |
||
235 | |||
236 | public function addCategory(Category $category) |
||
240 | |||
241 | public function removeCategory(Category $category) |
||
245 | |||
246 | /** |
||
247 | * @return mixed |
||
248 | */ |
||
249 | public function getCategories() |
||
253 | |||
254 | /** |
||
255 | * @return Tag[]|ArrayCollection |
||
256 | */ |
||
257 | public function getTags() |
||
261 | |||
262 | /** |
||
263 | * @param Tag $tag |
||
264 | */ |
||
265 | public function addTag(Tag $tag) |
||
272 | |||
273 | /** |
||
274 | * @param Tag $tag |
||
275 | */ |
||
276 | public function removeTag(Tag $tag) |
||
281 | |||
282 | public function setTags(array $tags) |
||
286 | } |
||
287 |