From e8911f7c09fa9d8009d7c7ee9fb0c181d2ffbc31 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 10 Jun 2017 15:00:52 +0200 Subject: Add isPublic filter on entries --- src/Wallabag/CoreBundle/Entity/Entry.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 9a7dd4e7..365030c7 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -684,6 +684,16 @@ class Entry $this->uid = null; } + /** + * Used in the entries filter so it's more explicit for the end user than the uid. + * + * @return bool + */ + public function isPublic() + { + return null !== $this->uid; + } + /** * @return string */ -- cgit v1.2.3 From 1112e54772c9308ee3d7417869b5b8ef9b2b9812 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 10 Jun 2017 15:31:57 +0200 Subject: Add public filter/field in the API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Listing entries can now be filtered by “public”. Creating or patching an entry can now set is to public or remove the public. Entry response now include “is_public” boolean field --- src/Wallabag/CoreBundle/Entity/Entry.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 365030c7..07d41ed8 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -687,6 +687,10 @@ class Entry /** * 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() -- cgit v1.2.3 From a9c6577f0c51dd4282e022fa4b41cbb7b0e201b3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 10 Jun 2017 15:37:25 +0200 Subject: Few fixes --- src/Wallabag/CoreBundle/Entity/Entry.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 07d41ed8..a0503c39 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -686,6 +686,7 @@ class Entry /** * Used in the entries filter so it's more explicit for the end user than the uid. + * Also used in the API. * * @VirtualProperty * @SerializedName("is_public") -- cgit v1.2.3