]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
use integers for archived/starred status
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index 5e608f05d909a57d99ab0b8a4977721d510e5ae9..8f4ddf613212d96fc640589f95646fce805ec87b 100644 (file)
@@ -59,6 +59,8 @@ class Entry
     /**
      * @var bool
      *
+     * @Exclude
+     *
      * @ORM\Column(name="is_archived", type="boolean")
      *
      * @Groups({"entries_for_user", "export_all"})
@@ -68,6 +70,8 @@ class Entry
     /**
      * @var bool
      *
+     * @Exclude
+     *
      * @ORM\Column(name="is_starred", type="boolean")
      *
      * @Groups({"entries_for_user", "export_all"})
@@ -271,6 +275,16 @@ class Entry
         return $this->isArchived;
     }
 
+    /**
+     * @VirtualProperty
+     * @SerializedName("is_archived")
+     * @Groups({"entries_for_user", "export_all"})
+     */
+    public function is_Archived()
+    {
+        return (int) $this->isArchived();
+    }
+
     public function toggleArchive()
     {
         $this->isArchived = $this->isArchived() ^ 1;
@@ -302,6 +316,16 @@ class Entry
         return $this->isStarred;
     }
 
+    /**
+     * @VirtualProperty
+     * @SerializedName("is_starred")
+     * @Groups({"entries_for_user", "export_all"})
+     */
+    public function is_Starred()
+    {
+        return (int) $this->isStarred();
+    }
+
     public function toggleStar()
     {
         $this->isStarred = $this->isStarred() ^ 1;