]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Add public filter/field in the API
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index 9a7dd4e7b77e43613e7a1048a847fda7afb724d4..07d41ed8f8c65748586041eeb3118d26a6294605 100644 (file)
@@ -684,6 +684,20 @@ class Entry
         $this->uid = null;
     }
 
+    /**
+     * Used in the entries filter so it's more explicit for the end user than the uid.
+     *
+     * @VirtualProperty
+     * @SerializedName("is_public")
+     * @Groups({"entries_for_user"})
+     *
+     * @return bool
+     */
+    public function isPublic()
+    {
+        return null !== $this->uid;
+    }
+
     /**
      * @return string
      */