aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Entry.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-03-16 20:41:29 +0100
committerThomas Citharel <tcit@tcit.fr>2016-03-16 22:22:12 +0100
commit189ef6342a3f9befec379c406821ed10730cacd2 (patch)
tree2def34d5dfb903889c457c85a686726fc6911ec1 /src/Wallabag/CoreBundle/Entity/Entry.php
parent0d3043a29c4aba541d6a18c2d5cc7ebffc6ddc78 (diff)
downloadwallabag-189ef6342a3f9befec379c406821ed10730cacd2.tar.gz
wallabag-189ef6342a3f9befec379c406821ed10730cacd2.tar.zst
wallabag-189ef6342a3f9befec379c406821ed10730cacd2.zip
use integers for archived/starred status
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 5e608f05..8f4ddf61 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -59,6 +59,8 @@ class Entry
59 /** 59 /**
60 * @var bool 60 * @var bool
61 * 61 *
62 * @Exclude
63 *
62 * @ORM\Column(name="is_archived", type="boolean") 64 * @ORM\Column(name="is_archived", type="boolean")
63 * 65 *
64 * @Groups({"entries_for_user", "export_all"}) 66 * @Groups({"entries_for_user", "export_all"})
@@ -68,6 +70,8 @@ class Entry
68 /** 70 /**
69 * @var bool 71 * @var bool
70 * 72 *
73 * @Exclude
74 *
71 * @ORM\Column(name="is_starred", type="boolean") 75 * @ORM\Column(name="is_starred", type="boolean")
72 * 76 *
73 * @Groups({"entries_for_user", "export_all"}) 77 * @Groups({"entries_for_user", "export_all"})
@@ -271,6 +275,16 @@ class Entry
271 return $this->isArchived; 275 return $this->isArchived;
272 } 276 }
273 277
278 /**
279 * @VirtualProperty
280 * @SerializedName("is_archived")
281 * @Groups({"entries_for_user", "export_all"})
282 */
283 public function is_Archived()
284 {
285 return (int) $this->isArchived();
286 }
287
274 public function toggleArchive() 288 public function toggleArchive()
275 { 289 {
276 $this->isArchived = $this->isArchived() ^ 1; 290 $this->isArchived = $this->isArchived() ^ 1;
@@ -302,6 +316,16 @@ class Entry
302 return $this->isStarred; 316 return $this->isStarred;
303 } 317 }
304 318
319 /**
320 * @VirtualProperty
321 * @SerializedName("is_starred")
322 * @Groups({"entries_for_user", "export_all"})
323 */
324 public function is_Starred()
325 {
326 return (int) $this->isStarred();
327 }
328
305 public function toggleStar() 329 public function toggleStar()
306 { 330 {
307 $this->isStarred = $this->isStarred() ^ 1; 331 $this->isStarred = $this->isStarred() ^ 1;