aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php31
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php69
2 files changed, 94 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index a25656d3..d0f0e3f3 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -81,6 +81,13 @@ class Config
81 private $readingSpeed; 81 private $readingSpeed;
82 82
83 /** 83 /**
84 * @var string
85 *
86 * @ORM\Column(name="pocket_consumer_key", type="string", nullable=true)
87 */
88 private $pocketConsumerKey;
89
90 /**
84 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") 91 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
85 */ 92 */
86 private $user; 93 private $user;
@@ -279,6 +286,30 @@ class Config
279 } 286 }
280 287
281 /** 288 /**
289 * Set pocketConsumerKey.
290 *
291 * @param string $pocketConsumerKey
292 *
293 * @return Config
294 */
295 public function setPocketConsumerKey($pocketConsumerKey)
296 {
297 $this->pocketConsumerKey = $pocketConsumerKey;
298
299 return $this;
300 }
301
302 /**
303 * Get pocketConsumerKey.
304 *
305 * @return string
306 */
307 public function getPocketConsumerKey()
308 {
309 return $this->pocketConsumerKey;
310 }
311
312 /**
282 * @param TaggingRule $rule 313 * @param TaggingRule $rule
283 * 314 *
284 * @return Config 315 * @return Config
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index ceae78b0..a4b0d7a8 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -40,6 +40,15 @@ class Entry
40 /** 40 /**
41 * @var string 41 * @var string
42 * 42 *
43 * @ORM\Column(name="uuid", type="text", nullable=true)
44 *
45 * @Groups({"entries_for_user", "export_all"})
46 */
47 private $uuid;
48
49 /**
50 * @var string
51 *
43 * @ORM\Column(name="title", type="text", nullable=true) 52 * @ORM\Column(name="title", type="text", nullable=true)
44 * 53 *
45 * @Groups({"entries_for_user", "export_all"}) 54 * @Groups({"entries_for_user", "export_all"})
@@ -88,20 +97,20 @@ class Entry
88 private $content; 97 private $content;
89 98
90 /** 99 /**
91 * @var date 100 * @var \DateTime
92 * 101 *
93 * @ORM\Column(name="created_at", type="datetime") 102 * @ORM\Column(name="created_at", type="datetime")
94 * 103 *
95 * @Groups({"export_all"}) 104 * @Groups({"entries_for_user", "export_all"})
96 */ 105 */
97 private $createdAt; 106 private $createdAt;
98 107
99 /** 108 /**
100 * @var date 109 * @var \DateTime
101 * 110 *
102 * @ORM\Column(name="updated_at", type="datetime") 111 * @ORM\Column(name="updated_at", type="datetime")
103 * 112 *
104 * @Groups({"export_all"}) 113 * @Groups({"entries_for_user", "export_all"})
105 */ 114 */
106 private $updatedAt; 115 private $updatedAt;
107 116
@@ -401,7 +410,22 @@ class Entry
401 } 410 }
402 411
403 /** 412 /**
404 * @return string 413 * Set created_at.
414 * Only used when importing data from an other service.
415 *
416 * @param \DateTime $createdAt
417 *
418 * @return Entry
419 */
420 public function setCreatedAt(\DateTime $createdAt)
421 {
422 $this->createdAt = $createdAt;
423
424 return $this;
425 }
426
427 /**
428 * @return \DateTime
405 */ 429 */
406 public function getCreatedAt() 430 public function getCreatedAt()
407 { 431 {
@@ -409,7 +433,7 @@ class Entry
409 } 433 }
410 434
411 /** 435 /**
412 * @return string 436 * @return \DateTime
413 */ 437 */
414 public function getUpdatedAt() 438 public function getUpdatedAt()
415 { 439 {
@@ -595,4 +619,37 @@ class Entry
595 { 619 {
596 return $this->language; 620 return $this->language;
597 } 621 }
622
623 /**
624 * @return string
625 */
626 public function getUuid()
627 {
628 return $this->uuid;
629 }
630
631 /**
632 * @param string $uuid
633 *
634 * @return Entry
635 */
636 public function setUuid($uuid)
637 {
638 $this->uuid = $uuid;
639
640 return $this;
641 }
642
643 public function generateUuid()
644 {
645 if (null === $this->uuid) {
646 // @see http://blog.kevingomez.fr/til/2015/07/26/why-is-uniqid-slow/ for true parameter
647 $this->uuid = uniqid('', true);
648 }
649 }
650
651 public function cleanUuid()
652 {
653 $this->uuid = null;
654 }
598} 655}