]> git.immae.eu Git - github/wallabag/wallabag.git/blame_incremental - src/Wallabag/CoreBundle/Entity/Entries.php
Merge pull request #1055 from wallabag/v2-api-patch-methid
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entries.php
... / ...
CommitLineData
1<?php
2
3namespace Wallabag\CoreBundle\Entity;
4
5use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Validator\Constraints as Assert;
7
8/**
9 * Entries
10 *
11 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntriesRepository")
12 * @ORM\Table(name="entries")
13 * @ORM\HasLifecycleCallbacks()
14 *
15 */
16class Entries
17{
18 /**
19 * @var integer
20 *
21 * @ORM\Column(name="id", type="integer", nullable=true)
22 * @ORM\Id
23 * @ORM\GeneratedValue(strategy="AUTO")
24 */
25 private $id = null;
26
27 /**
28 * @var string
29 *
30 * @ORM\Column(name="title", type="text", nullable=true)
31 */
32 private $title;
33
34 /**
35 * @var string
36 *
37 * @Assert\NotBlank()
38 * @ORM\Column(name="url", type="text", nullable=true)
39 */
40 private $url;
41
42 /**
43 * @var boolean
44 *
45 * @ORM\Column(name="is_read", type="boolean", nullable=true, options={"default" = false})
46 */
47 private $isRead = false;
48
49 /**
50 * @var boolean
51 *
52 * @ORM\Column(name="is_fav", type="boolean", nullable=true, options={"default" = false})
53 */
54 private $isFav = false;
55
56 /**
57 * @var boolean
58 *
59 * @ORM\Column(name="is_deleted", type="boolean", nullable=true, options={"default" = false})
60 */
61 private $isDeleted = false;
62
63 /**
64 * @var string
65 *
66 * @ORM\Column(name="content", type="text", nullable=true)
67 */
68 private $content;
69
70 /**
71 * @var date
72 *
73 * @ORM\Column(name="created_at", type="datetime", nullable=true)
74 */
75 private $createdAt;
76
77 /**
78 * @var date
79 *
80 * @ORM\Column(name="updated_at", type="datetime", nullable=true)
81 */
82 private $updatedAt;
83
84 /**
85 * @var string
86 *
87 * @ORM\Column(name="user_id", type="decimal", precision=10, scale=0, nullable=true)
88 */
89 private $userId;
90
91 /**
92 * @var string
93 *
94 * @ORM\Column(name="comments", type="text", nullable=true)
95 */
96 private $comments;
97
98 /**
99 * @var string
100 *
101 * @ORM\Column(name="mimetype", type="text", nullable=true)
102 */
103 private $mimetype;
104
105 /**
106 * @var integer
107 *
108 * @ORM\Column(name="reading_type", type="integer", nullable=true)
109 */
110 private $readingTime;
111
112 /**
113 * @var string
114 *
115 * @ORM\Column(name="domain_name", type="text", nullable=true)
116 */
117 private $domainName;
118
119 /**
120 * @var boolean
121 *
122 * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false})
123 */
124 private $isPublic;
125
126 /**
127 * Get id
128 *
129 * @return integer
130 */
131 public function getId()
132 {
133 return $this->id;
134 }
135
136 /**
137 * Set title
138 *
139 * @param string $title
140 * @return Entries
141 */
142 public function setTitle($title)
143 {
144 $this->title = $title;
145
146 return $this;
147 }
148
149 /**
150 * Get title
151 *
152 * @return string
153 */
154 public function getTitle()
155 {
156 return $this->title;
157 }
158
159 /**
160 * Set url
161 *
162 * @param string $url
163 * @return Entries
164 */
165 public function setUrl($url)
166 {
167 $this->url = $url;
168
169 return $this;
170 }
171
172 /**
173 * Get url
174 *
175 * @return string
176 */
177 public function getUrl()
178 {
179 return $this->url;
180 }
181
182 /**
183 * Set isRead
184 *
185 * @param string $isRead
186 * @return Entries
187 */
188 public function setRead($isRead)
189 {
190 $this->isRead = $isRead;
191
192 return $this;
193 }
194
195 /**
196 * Get isRead
197 *
198 * @return string
199 */
200 public function isRead()
201 {
202 return $this->isRead;
203 }
204
205 public function toggleArchive()
206 {
207 $this->isRead = $this->getIsRead() ^ 1;
208
209 return $this;
210 }
211
212 /**
213 * Set isFav
214 *
215 * @param string $isFav
216 * @return Entries
217 */
218 public function setFav($isFav)
219 {
220 $this->isFav = $isFav;
221
222 return $this;
223 }
224
225 /**
226 * Get isFav
227 *
228 * @return string
229 */
230 public function isFav()
231 {
232 return $this->isFav;
233 }
234
235 public function toggleStar()
236 {
237 $this->isFav = $this->getIsFav() ^ 1;
238
239 return $this;
240 }
241
242 /**
243 * Set content
244 *
245 * @param string $content
246 * @return Entries
247 */
248 public function setContent($content)
249 {
250 $this->content = $content;
251
252 return $this;
253 }
254
255 /**
256 * Get content
257 *
258 * @return string
259 */
260 public function getContent()
261 {
262 return $this->content;
263 }
264
265 /**
266 * Set userId
267 *
268 * @param string $userId
269 * @return Entries
270 */
271 public function setUserId($userId)
272 {
273 $this->userId = $userId;
274
275 return $this;
276 }
277
278 /**
279 * Get userId
280 *
281 * @return string
282 */
283 public function getUserId()
284 {
285 return $this->userId;
286 }
287
288 /**
289 * @return string
290 */
291 public function isDeleted()
292 {
293 return $this->isDeleted;
294 }
295
296 /**
297 * @param string $isDeleted
298 */
299 public function setDeleted($isDeleted)
300 {
301 $this->isDeleted = $isDeleted;
302 }
303
304 /**
305 * @return mixed
306 */
307 public function getCreatedAt()
308 {
309 return $this->createdAt;
310 }
311
312 /**
313 * @param mixed $createdAt
314 * @ORM\PrePersist
315 */
316 public function setCreatedAt()
317 {
318 $this->createdAt = new \DateTime();
319 }
320
321 /**
322 * @return string
323 */
324 public function getUpdatedAt()
325 {
326 return $this->updatedAt;
327 }
328
329 /**
330 * @param string $updatedAt
331 * @ORM\PreUpdate
332 */
333 public function setUpdatedAt()
334 {
335 $this->updatedAt = new \DateTime();
336 }
337
338 /**
339 * @return string
340 */
341 public function getComments()
342 {
343 return $this->comments;
344 }
345
346 /**
347 * @param string $comments
348 */
349 public function setComments($comments)
350 {
351 $this->comments = $comments;
352 }
353
354 /**
355 * @return string
356 */
357 public function getMimetype()
358 {
359 return $this->mimetype;
360 }
361
362 /**
363 * @param string $mimetype
364 */
365 public function setMimetype($mimetype)
366 {
367 $this->mimetype = $mimetype;
368 }
369
370 /**
371 * @return int
372 */
373 public function getReadingTime()
374 {
375 return $this->readingTime;
376 }
377
378 /**
379 * @param int $readingTime
380 */
381 public function setReadingTime($readingTime)
382 {
383 $this->readingTime = $readingTime;
384 }
385
386 /**
387 * @return string
388 */
389 public function getDomainName()
390 {
391 return $this->domainName;
392 }
393
394 /**
395 * @param string $domainName
396 */
397 public function setDomainName($domainName)
398 {
399 $this->domainName = $domainName;
400 }
401
402 /**
403 * @return boolean
404 */
405 public function isPublic()
406 {
407 return $this->isPublic;
408 }
409
410 /**
411 * @param boolean $isPublic
412 */
413 public function setPublic($isPublic)
414 {
415 $this->isPublic = $isPublic;
416 }
417}