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/Entry.php49
-rw-r--r--src/Wallabag/CoreBundle/Entity/SiteCredential.php17
-rw-r--r--src/Wallabag/CoreBundle/Entity/TaggingRule.php2
3 files changed, 66 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 2b1f2e05..b3cfdc4a 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -87,6 +87,15 @@ class Entry
87 private $isArchived = false; 87 private $isArchived = false;
88 88
89 /** 89 /**
90 * @var \DateTime
91 *
92 * @ORM\Column(name="archived_at", type="datetime", nullable=true)
93 *
94 * @Groups({"entries_for_user", "export_all"})
95 */
96 private $archivedAt = null;
97
98 /**
90 * @var bool 99 * @var bool
91 * 100 *
92 * @Exclude 101 * @Exclude
@@ -336,6 +345,44 @@ class Entry
336 } 345 }
337 346
338 /** 347 /**
348 * update isArchived and archive_at fields.
349 *
350 * @param bool $isArchived
351 *
352 * @return Entry
353 */
354 public function updateArchived($isArchived = false)
355 {
356 $this->setArchived($isArchived);
357 $this->setArchivedAt(null);
358 if ($this->isArchived()) {
359 $this->setArchivedAt(new \DateTime());
360 }
361
362 return $this;
363 }
364
365 /**
366 * @return \DateTime|null
367 */
368 public function getArchivedAt()
369 {
370 return $this->archivedAt;
371 }
372
373 /**
374 * @param \DateTime|null $archivedAt
375 *
376 * @return Entry
377 */
378 public function setArchivedAt($archivedAt = null)
379 {
380 $this->archivedAt = $archivedAt;
381
382 return $this;
383 }
384
385 /**
339 * Get isArchived. 386 * Get isArchived.
340 * 387 *
341 * @return bool 388 * @return bool
@@ -357,7 +404,7 @@ class Entry
357 404
358 public function toggleArchive() 405 public function toggleArchive()
359 { 406 {
360 $this->isArchived = $this->isArchived() ^ 1; 407 $this->updateArchived($this->isArchived() ^ 1);
361 408
362 return $this; 409 return $this;
363 } 410 }
diff --git a/src/Wallabag/CoreBundle/Entity/SiteCredential.php b/src/Wallabag/CoreBundle/Entity/SiteCredential.php
index ac714359..dee48fd5 100644
--- a/src/Wallabag/CoreBundle/Entity/SiteCredential.php
+++ b/src/Wallabag/CoreBundle/Entity/SiteCredential.php
@@ -60,6 +60,13 @@ class SiteCredential
60 private $createdAt; 60 private $createdAt;
61 61
62 /** 62 /**
63 * @var \DateTime
64 *
65 * @ORM\Column(name="updated_at", type="datetime")
66 */
67 private $updatedAt;
68
69 /**
63 * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="siteCredentials") 70 * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="siteCredentials")
64 */ 71 */
65 private $user; 72 private $user;
@@ -179,6 +186,16 @@ class SiteCredential
179 } 186 }
180 187
181 /** 188 /**
189 * Get updatedAt.
190 *
191 * @return \DateTime
192 */
193 public function getUpdatedAt()
194 {
195 return $this->updatedAt;
196 }
197
198 /**
182 * @return User 199 * @return User
183 */ 200 */
184 public function getUser() 201 public function getUser()
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
index 84e11e26..c1be3165 100644
--- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php
+++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
@@ -3,7 +3,7 @@
3namespace Wallabag\CoreBundle\Entity; 3namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert; 6use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
7use Symfony\Component\Validator\Constraints as Assert; 7use Symfony\Component\Validator\Constraints as Assert;
8 8
9/** 9/**