]>
Commit | Line | Data |
---|---|---|
9d50517c NL |
1 | <?php |
2 | ||
ad4d1caa | 3 | namespace Wallabag\CoreBundle\Entity; |
9d50517c | 4 | |
0a018fe0 | 5 | use Doctrine\Common\Collections\ArrayCollection; |
9d50517c | 6 | use Doctrine\ORM\Mapping as ORM; |
0f006880 | 7 | use Hateoas\Configuration\Annotation as Hateoas; |
268e9e72 | 8 | use JMS\Serializer\Annotation\Groups; |
0f006880 | 9 | use JMS\Serializer\Annotation\XmlRoot; |
7d1fdab2 TC |
10 | use JMS\Serializer\Annotation\Exclude; |
11 | use JMS\Serializer\Annotation\VirtualProperty; | |
12 | use JMS\Serializer\Annotation\SerializedName; | |
619cc453 | 13 | use Symfony\Component\Validator\Constraints as Assert; |
1210dae1 | 14 | use Wallabag\UserBundle\Entity\User; |
4dc87223 | 15 | use Wallabag\AnnotationBundle\Entity\Annotation; |
9d50517c NL |
16 | |
17 | /** | |
4346a860 | 18 | * Entry. |
9d50517c | 19 | * |
0f006880 | 20 | * @XmlRoot("entry") |
be463487 | 21 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") |
7e9c1d65 JB |
22 | * @ORM\Table( |
23 | * name="`entry`", | |
24 | * options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}, | |
81375151 NL |
25 | * indexes={ |
26 | * @ORM\Index(name="created_at", columns={"created_at"}), | |
7239082a | 27 | * @ORM\Index(name="uid", columns={"uid"}) |
81375151 | 28 | * } |
7e9c1d65 | 29 | * ) |
34d15eb4 | 30 | * @ORM\HasLifecycleCallbacks() |
0f006880 | 31 | * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") |
9d50517c | 32 | */ |
be463487 | 33 | class Entry |
9d50517c | 34 | { |
0f006880 | 35 | /** @Serializer\XmlAttribute */ |
9d50517c | 36 | /** |
4346a860 | 37 | * @var int |
9d50517c | 38 | * |
be463487 | 39 | * @ORM\Column(name="id", type="integer") |
9d50517c | 40 | * @ORM\Id |
34d15eb4 | 41 | * @ORM\GeneratedValue(strategy="AUTO") |
5b7da076 TC |
42 | * |
43 | * @Groups({"entries_for_user", "export_all"}) | |
9d50517c | 44 | */ |
be463487 | 45 | private $id; |
9d50517c | 46 | |
f3d0cb91 | 47 | /** |
78b3c31d | 48 | * @var string |
f3d0cb91 | 49 | * |
7239082a | 50 | * @ORM\Column(name="uid", type="string", length=23, nullable=true) |
f3d0cb91 NL |
51 | * |
52 | * @Groups({"entries_for_user", "export_all"}) | |
53 | */ | |
7239082a | 54 | private $uid; |
f3d0cb91 | 55 | |
9d50517c NL |
56 | /** |
57 | * @var string | |
58 | * | |
59 | * @ORM\Column(name="title", type="text", nullable=true) | |
5b7da076 TC |
60 | * |
61 | * @Groups({"entries_for_user", "export_all"}) | |
9d50517c NL |
62 | */ |
63 | private $title; | |
64 | ||
65 | /** | |
66 | * @var string | |
67 | * | |
b84a8055 | 68 | * @Assert\NotBlank() |
9d50517c | 69 | * @ORM\Column(name="url", type="text", nullable=true) |
5b7da076 TC |
70 | * |
71 | * @Groups({"entries_for_user", "export_all"}) | |
9d50517c NL |
72 | */ |
73 | private $url; | |
74 | ||
75 | /** | |
4346a860 | 76 | * @var bool |
9d50517c | 77 | * |
189ef634 TC |
78 | * @Exclude |
79 | * | |
be463487 | 80 | * @ORM\Column(name="is_archived", type="boolean") |
5b7da076 TC |
81 | * |
82 | * @Groups({"entries_for_user", "export_all"}) | |
9d50517c | 83 | */ |
905ae369 | 84 | private $isArchived = false; |
9d50517c NL |
85 | |
86 | /** | |
4346a860 | 87 | * @var bool |
9d50517c | 88 | * |
189ef634 TC |
89 | * @Exclude |
90 | * | |
be463487 | 91 | * @ORM\Column(name="is_starred", type="boolean") |
5b7da076 TC |
92 | * |
93 | * @Groups({"entries_for_user", "export_all"}) | |
9d50517c | 94 | */ |
905ae369 | 95 | private $isStarred = false; |
9d50517c | 96 | |
9d50517c NL |
97 | /** |
98 | * @var string | |
99 | * | |
eacaf7f8 | 100 | * @ORM\Column(name="content", type="text", nullable=true) |
5b7da076 TC |
101 | * |
102 | * @Groups({"entries_for_user", "export_all"}) | |
9d50517c | 103 | */ |
eacaf7f8 | 104 | private $content; |
9d50517c | 105 | |
34d15eb4 | 106 | /** |
8664069e | 107 | * @var \DateTime |
34d15eb4 | 108 | * |
be463487 | 109 | * @ORM\Column(name="created_at", type="datetime") |
5b7da076 | 110 | * |
9401696f | 111 | * @Groups({"entries_for_user", "export_all"}) |
34d15eb4 NL |
112 | */ |
113 | private $createdAt; | |
114 | ||
115 | /** | |
8664069e | 116 | * @var \DateTime |
34d15eb4 | 117 | * |
be463487 | 118 | * @ORM\Column(name="updated_at", type="datetime") |
5b7da076 | 119 | * |
9401696f | 120 | * @Groups({"entries_for_user", "export_all"}) |
34d15eb4 NL |
121 | */ |
122 | private $updatedAt; | |
123 | ||
34d15eb4 | 124 | /** |
4dc87223 | 125 | * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) |
f38e03dc | 126 | * @ORM\JoinTable |
5b7da076 | 127 | * |
f38e03dc | 128 | * @Groups({"entries_for_user", "export_all"}) |
34d15eb4 | 129 | */ |
4dc87223 | 130 | private $annotations; |
34d15eb4 NL |
131 | |
132 | /** | |
133 | * @var string | |
134 | * | |
135 | * @ORM\Column(name="mimetype", type="text", nullable=true) | |
5b7da076 TC |
136 | * |
137 | * @Groups({"entries_for_user", "export_all"}) | |
34d15eb4 NL |
138 | */ |
139 | private $mimetype; | |
140 | ||
98f0929f JB |
141 | /** |
142 | * @var string | |
143 | * | |
144 | * @ORM\Column(name="language", type="text", nullable=true) | |
5b7da076 TC |
145 | * |
146 | * @Groups({"entries_for_user", "export_all"}) | |
98f0929f JB |
147 | */ |
148 | private $language; | |
149 | ||
34d15eb4 | 150 | /** |
4346a860 | 151 | * @var int |
34d15eb4 | 152 | * |
26864574 | 153 | * @ORM\Column(name="reading_time", type="integer", nullable=true) |
5b7da076 TC |
154 | * |
155 | * @Groups({"entries_for_user", "export_all"}) | |
34d15eb4 NL |
156 | */ |
157 | private $readingTime; | |
158 | ||
159 | /** | |
160 | * @var string | |
161 | * | |
162 | * @ORM\Column(name="domain_name", type="text", nullable=true) | |
5b7da076 TC |
163 | * |
164 | * @Groups({"entries_for_user", "export_all"}) | |
34d15eb4 NL |
165 | */ |
166 | private $domainName; | |
167 | ||
fad31615 JB |
168 | /** |
169 | * @var string | |
170 | * | |
171 | * @ORM\Column(name="preview_picture", type="text", nullable=true) | |
5b7da076 TC |
172 | * |
173 | * @Groups({"entries_for_user", "export_all"}) | |
fad31615 JB |
174 | */ |
175 | private $previewPicture; | |
176 | ||
34d15eb4 | 177 | /** |
4346a860 | 178 | * @var bool |
34d15eb4 NL |
179 | * |
180 | * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false}) | |
5b7da076 TC |
181 | * |
182 | * @Groups({"export_all"}) | |
34d15eb4 NL |
183 | */ |
184 | private $isPublic; | |
185 | ||
10b35097 | 186 | /** |
e10e6ab3 | 187 | * @var string |
10b35097 | 188 | * |
3ef75cc4 | 189 | * @ORM\Column(name="http_status", type="string", length=3, nullable=true) |
10b35097 NL |
190 | * |
191 | * @Groups({"entries_for_user", "export_all"}) | |
192 | */ | |
193 | private $httpStatus; | |
194 | ||
5f09650e | 195 | /** |
7d1fdab2 TC |
196 | * @Exclude |
197 | * | |
1210dae1 | 198 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries") |
5b7da076 TC |
199 | * |
200 | * @Groups({"export_all"}) | |
5f09650e NL |
201 | */ |
202 | private $user; | |
203 | ||
0a018fe0 | 204 | /** |
af95c09c | 205 | * @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist"}) |
e42b13bc JB |
206 | * @ORM\JoinTable( |
207 | * name="entry_tag", | |
208 | * joinColumns={ | |
206bade5 | 209 | * @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="cascade") |
e42b13bc JB |
210 | * }, |
211 | * inverseJoinColumns={ | |
206bade5 | 212 | * @ORM\JoinColumn(name="tag_id", referencedColumnName="id", onDelete="cascade") |
e42b13bc JB |
213 | * } |
214 | * ) | |
0a018fe0 NL |
215 | */ |
216 | private $tags; | |
217 | ||
5f09650e NL |
218 | /* |
219 | * @param User $user | |
220 | */ | |
5d6f6f56 | 221 | public function __construct(User $user) |
5f09650e NL |
222 | { |
223 | $this->user = $user; | |
0a018fe0 | 224 | $this->tags = new ArrayCollection(); |
5f09650e NL |
225 | } |
226 | ||
9d50517c | 227 | /** |
4346a860 | 228 | * Get id. |
9d50517c | 229 | * |
4346a860 | 230 | * @return int |
9d50517c NL |
231 | */ |
232 | public function getId() | |
233 | { | |
234 | return $this->id; | |
235 | } | |
236 | ||
237 | /** | |
4346a860 JB |
238 | * Set title. |
239 | * | |
240 | * @param string $title | |
9d50517c | 241 | * |
be463487 | 242 | * @return Entry |
9d50517c NL |
243 | */ |
244 | public function setTitle($title) | |
245 | { | |
246 | $this->title = $title; | |
247 | ||
248 | return $this; | |
249 | } | |
250 | ||
251 | /** | |
4346a860 | 252 | * Get title. |
9d50517c | 253 | * |
7df80cb3 | 254 | * @return string |
9d50517c NL |
255 | */ |
256 | public function getTitle() | |
257 | { | |
258 | return $this->title; | |
259 | } | |
260 | ||
261 | /** | |
4346a860 JB |
262 | * Set url. |
263 | * | |
264 | * @param string $url | |
9d50517c | 265 | * |
be463487 | 266 | * @return Entry |
9d50517c NL |
267 | */ |
268 | public function setUrl($url) | |
269 | { | |
270 | $this->url = $url; | |
271 | ||
272 | return $this; | |
273 | } | |
274 | ||
275 | /** | |
4346a860 | 276 | * Get url. |
9d50517c | 277 | * |
7df80cb3 | 278 | * @return string |
9d50517c NL |
279 | */ |
280 | public function getUrl() | |
281 | { | |
282 | return $this->url; | |
283 | } | |
284 | ||
285 | /** | |
4346a860 JB |
286 | * Set isArchived. |
287 | * | |
8eedc8cf | 288 | * @param bool $isArchived |
9d50517c | 289 | * |
be463487 | 290 | * @return Entry |
9d50517c | 291 | */ |
905ae369 | 292 | public function setArchived($isArchived) |
9d50517c | 293 | { |
905ae369 | 294 | $this->isArchived = $isArchived; |
9d50517c NL |
295 | |
296 | return $this; | |
297 | } | |
298 | ||
299 | /** | |
4346a860 | 300 | * Get isArchived. |
9d50517c | 301 | * |
8eedc8cf | 302 | * @return bool |
9d50517c | 303 | */ |
905ae369 | 304 | public function isArchived() |
9d50517c | 305 | { |
905ae369 | 306 | return $this->isArchived; |
9d50517c NL |
307 | } |
308 | ||
189ef634 TC |
309 | /** |
310 | * @VirtualProperty | |
311 | * @SerializedName("is_archived") | |
312 | * @Groups({"entries_for_user", "export_all"}) | |
313 | */ | |
314 | public function is_Archived() | |
315 | { | |
316 | return (int) $this->isArchived(); | |
317 | } | |
318 | ||
163eae0b NL |
319 | public function toggleArchive() |
320 | { | |
905ae369 | 321 | $this->isArchived = $this->isArchived() ^ 1; |
7df80cb3 | 322 | |
163eae0b NL |
323 | return $this; |
324 | } | |
325 | ||
9d50517c | 326 | /** |
4346a860 JB |
327 | * Set isStarred. |
328 | * | |
8eedc8cf | 329 | * @param bool $isStarred |
9d50517c | 330 | * |
be463487 | 331 | * @return Entry |
9d50517c | 332 | */ |
905ae369 | 333 | public function setStarred($isStarred) |
9d50517c | 334 | { |
905ae369 | 335 | $this->isStarred = $isStarred; |
9d50517c NL |
336 | |
337 | return $this; | |
338 | } | |
339 | ||
340 | /** | |
4346a860 | 341 | * Get isStarred. |
9d50517c | 342 | * |
8eedc8cf | 343 | * @return bool |
9d50517c | 344 | */ |
905ae369 | 345 | public function isStarred() |
9d50517c | 346 | { |
905ae369 | 347 | return $this->isStarred; |
9d50517c NL |
348 | } |
349 | ||
189ef634 TC |
350 | /** |
351 | * @VirtualProperty | |
352 | * @SerializedName("is_starred") | |
353 | * @Groups({"entries_for_user", "export_all"}) | |
354 | */ | |
355 | public function is_Starred() | |
356 | { | |
357 | return (int) $this->isStarred(); | |
358 | } | |
359 | ||
163eae0b NL |
360 | public function toggleStar() |
361 | { | |
905ae369 | 362 | $this->isStarred = $this->isStarred() ^ 1; |
163eae0b NL |
363 | |
364 | return $this; | |
365 | } | |
366 | ||
9d50517c | 367 | /** |
4346a860 JB |
368 | * Set content. |
369 | * | |
370 | * @param string $content | |
9d50517c | 371 | * |
be463487 | 372 | * @return Entry |
9d50517c NL |
373 | */ |
374 | public function setContent($content) | |
375 | { | |
376 | $this->content = $content; | |
377 | ||
378 | return $this; | |
379 | } | |
380 | ||
381 | /** | |
4346a860 | 382 | * Get content. |
9d50517c | 383 | * |
7df80cb3 | 384 | * @return string |
9d50517c NL |
385 | */ |
386 | public function getContent() | |
387 | { | |
388 | return $this->content; | |
389 | } | |
390 | ||
391 | /** | |
5f09650e | 392 | * @return User |
9d50517c | 393 | */ |
5f09650e | 394 | public function getUser() |
9d50517c | 395 | { |
5f09650e | 396 | return $this->user; |
9d50517c | 397 | } |
42a90646 | 398 | |
7d1fdab2 TC |
399 | /** |
400 | * @VirtualProperty | |
401 | * @SerializedName("user_name") | |
402 | */ | |
403 | public function getUserName() | |
404 | { | |
405 | return $this->user->getUserName(); | |
406 | } | |
407 | ||
408 | /** | |
409 | * @VirtualProperty | |
410 | * @SerializedName("user_email") | |
411 | */ | |
412 | public function getUserEmail() | |
413 | { | |
414 | return $this->user->getEmail(); | |
415 | } | |
416 | ||
417 | /** | |
418 | * @VirtualProperty | |
419 | * @SerializedName("user_id") | |
420 | */ | |
421 | public function getUserId() | |
422 | { | |
423 | return $this->user->getId(); | |
424 | } | |
425 | ||
34d15eb4 | 426 | /** |
6d65c0a8 JB |
427 | * Set created_at. |
428 | * Only used when importing data from an other service. | |
429 | * | |
8664069e | 430 | * @param \DateTime $createdAt |
6d65c0a8 JB |
431 | * |
432 | * @return Entry | |
433 | */ | |
434 | public function setCreatedAt(\DateTime $createdAt) | |
435 | { | |
436 | $this->createdAt = $createdAt; | |
437 | ||
438 | return $this; | |
439 | } | |
440 | ||
441 | /** | |
8664069e | 442 | * @return \DateTime |
34d15eb4 NL |
443 | */ |
444 | public function getCreatedAt() | |
445 | { | |
446 | return $this->createdAt; | |
447 | } | |
448 | ||
34d15eb4 | 449 | /** |
8664069e | 450 | * @return \DateTime |
34d15eb4 NL |
451 | */ |
452 | public function getUpdatedAt() | |
453 | { | |
454 | return $this->updatedAt; | |
455 | } | |
456 | ||
457 | /** | |
be463487 | 458 | * @ORM\PrePersist |
34d15eb4 NL |
459 | * @ORM\PreUpdate |
460 | */ | |
be463487 | 461 | public function timestamps() |
34d15eb4 | 462 | { |
be463487 NL |
463 | if (is_null($this->createdAt)) { |
464 | $this->createdAt = new \DateTime(); | |
465 | } | |
466 | ||
34d15eb4 NL |
467 | $this->updatedAt = new \DateTime(); |
468 | } | |
469 | ||
470 | /** | |
4dc87223 | 471 | * @return ArrayCollection<Annotation> |
34d15eb4 | 472 | */ |
4dc87223 | 473 | public function getAnnotations() |
34d15eb4 | 474 | { |
4dc87223 | 475 | return $this->annotations; |
34d15eb4 NL |
476 | } |
477 | ||
478 | /** | |
4dc87223 | 479 | * @param Annotation $annotation |
34d15eb4 | 480 | */ |
4dc87223 | 481 | public function setAnnotation(Annotation $annotation) |
34d15eb4 | 482 | { |
4dc87223 | 483 | $this->annotations[] = $annotation; |
34d15eb4 NL |
484 | } |
485 | ||
486 | /** | |
487 | * @return string | |
488 | */ | |
489 | public function getMimetype() | |
490 | { | |
491 | return $this->mimetype; | |
492 | } | |
493 | ||
494 | /** | |
495 | * @param string $mimetype | |
496 | */ | |
497 | public function setMimetype($mimetype) | |
498 | { | |
499 | $this->mimetype = $mimetype; | |
500 | } | |
501 | ||
502 | /** | |
503 | * @return int | |
504 | */ | |
505 | public function getReadingTime() | |
506 | { | |
507 | return $this->readingTime; | |
508 | } | |
509 | ||
510 | /** | |
511 | * @param int $readingTime | |
512 | */ | |
513 | public function setReadingTime($readingTime) | |
514 | { | |
515 | $this->readingTime = $readingTime; | |
516 | } | |
517 | ||
518 | /** | |
519 | * @return string | |
520 | */ | |
521 | public function getDomainName() | |
522 | { | |
523 | return $this->domainName; | |
524 | } | |
525 | ||
526 | /** | |
527 | * @param string $domainName | |
528 | */ | |
529 | public function setDomainName($domainName) | |
530 | { | |
531 | $this->domainName = $domainName; | |
532 | } | |
533 | ||
534 | /** | |
4346a860 | 535 | * @return bool |
34d15eb4 | 536 | */ |
2c093b03 | 537 | public function isPublic() |
34d15eb4 NL |
538 | { |
539 | return $this->isPublic; | |
540 | } | |
541 | ||
542 | /** | |
4346a860 | 543 | * @param bool $isPublic |
34d15eb4 | 544 | */ |
82d6d9cb | 545 | public function setIsPublic($isPublic) |
34d15eb4 NL |
546 | { |
547 | $this->isPublic = $isPublic; | |
548 | } | |
0a018fe0 NL |
549 | |
550 | /** | |
551 | * @return ArrayCollection<Tag> | |
552 | */ | |
553 | public function getTags() | |
554 | { | |
555 | return $this->tags; | |
556 | } | |
557 | ||
b0458874 JB |
558 | /** |
559 | * @VirtualProperty | |
560 | * @SerializedName("tags") | |
561 | * @Groups({"entries_for_user", "export_all"}) | |
562 | */ | |
563 | public function getSerializedTags() | |
564 | { | |
565 | $data = []; | |
566 | foreach ($this->tags as $tag) { | |
567 | $data[] = $tag->getLabel(); | |
568 | } | |
569 | ||
570 | return $data; | |
571 | } | |
572 | ||
0a018fe0 NL |
573 | /** |
574 | * @param Tag $tag | |
575 | */ | |
576 | public function addTag(Tag $tag) | |
577 | { | |
625acf33 KG |
578 | if ($this->tags->contains($tag)) { |
579 | return; | |
580 | } | |
581 | ||
fc031e57 JB |
582 | // check if tag already exist but has not yet be persisted |
583 | // it seems that the previous condition with `contains()` doesn't check that case | |
584 | foreach ($this->tags as $existingTag) { | |
fc732227 | 585 | if ($existingTag->getLabel() === $tag->getLabel()) { |
fc031e57 JB |
586 | return; |
587 | } | |
588 | } | |
589 | ||
e42b13bc | 590 | $this->tags->add($tag); |
46bbd8d3 | 591 | $tag->addEntry($this); |
0a018fe0 | 592 | } |
092ca707 NL |
593 | |
594 | public function removeTag(Tag $tag) | |
595 | { | |
e42b13bc JB |
596 | if (!$this->tags->contains($tag)) { |
597 | return; | |
598 | } | |
599 | ||
092ca707 | 600 | $this->tags->removeElement($tag); |
e42b13bc | 601 | $tag->removeEntry($this); |
092ca707 | 602 | } |
fad31615 JB |
603 | |
604 | /** | |
a1413a3d | 605 | * Set previewPicture. |
fad31615 JB |
606 | * |
607 | * @param string $previewPicture | |
608 | * | |
609 | * @return Entry | |
610 | */ | |
611 | public function setPreviewPicture($previewPicture) | |
612 | { | |
613 | $this->previewPicture = $previewPicture; | |
614 | ||
615 | return $this; | |
616 | } | |
617 | ||
618 | /** | |
a1413a3d | 619 | * Get previewPicture. |
fad31615 JB |
620 | * |
621 | * @return string | |
622 | */ | |
623 | public function getPreviewPicture() | |
624 | { | |
625 | return $this->previewPicture; | |
626 | } | |
98f0929f JB |
627 | |
628 | /** | |
629 | * Set language. | |
630 | * | |
631 | * @param string $language | |
632 | * | |
633 | * @return Entry | |
634 | */ | |
635 | public function setLanguage($language) | |
636 | { | |
637 | $this->language = $language; | |
638 | ||
639 | return $this; | |
640 | } | |
641 | ||
642 | /** | |
643 | * Get language. | |
644 | * | |
645 | * @return string | |
646 | */ | |
647 | public function getLanguage() | |
648 | { | |
649 | return $this->language; | |
650 | } | |
f3d0cb91 NL |
651 | |
652 | /** | |
78b3c31d | 653 | * @return string |
f3d0cb91 | 654 | */ |
7239082a | 655 | public function getUid() |
f3d0cb91 | 656 | { |
7239082a | 657 | return $this->uid; |
f3d0cb91 NL |
658 | } |
659 | ||
660 | /** | |
7239082a | 661 | * @param string $uid |
f3d0cb91 NL |
662 | * |
663 | * @return Entry | |
664 | */ | |
7239082a | 665 | public function setUid($uid) |
f3d0cb91 | 666 | { |
7239082a | 667 | $this->uid = $uid; |
f3d0cb91 NL |
668 | |
669 | return $this; | |
670 | } | |
671 | ||
7239082a | 672 | public function generateUid() |
f3d0cb91 | 673 | { |
7239082a | 674 | if (null === $this->uid) { |
a7e2218e | 675 | // @see http://blog.kevingomez.fr/til/2015/07/26/why-is-uniqid-slow/ for true parameter |
7239082a | 676 | $this->uid = uniqid('', true); |
f3d0cb91 NL |
677 | } |
678 | } | |
f1be7af4 | 679 | |
7239082a | 680 | public function cleanUid() |
f1be7af4 | 681 | { |
7239082a | 682 | $this->uid = null; |
f1be7af4 | 683 | } |
10b35097 NL |
684 | |
685 | /** | |
686 | * @return int | |
687 | */ | |
688 | public function getHttpStatus() | |
689 | { | |
690 | return $this->httpStatus; | |
691 | } | |
692 | ||
693 | /** | |
694 | * @param int $httpStatus | |
695 | * | |
696 | * @return Entry | |
697 | */ | |
698 | public function setHttpStatus($httpStatus) | |
699 | { | |
700 | $this->httpStatus = $httpStatus; | |
701 | ||
702 | return $this; | |
703 | } | |
9d50517c | 704 | } |