aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle
diff options
context:
space:
mode:
authorFrançois D <franek@users.noreply.github.com>2017-08-23 23:06:40 +0200
committerFrançois D <franek@users.noreply.github.com>2017-08-25 21:19:47 +0200
commita991c46eedec0efb24d0a9974b1c7fcabf8cfa66 (patch)
treefa33236c5ef67e023833c889eb52d5bed99d35bd /src/Wallabag/ApiBundle
parent2490f61dca635026a3eb9b5e9b6978b1981b1172 (diff)
downloadwallabag-a991c46eedec0efb24d0a9974b1c7fcabf8cfa66.tar.gz
wallabag-a991c46eedec0efb24d0a9974b1c7fcabf8cfa66.tar.zst
wallabag-a991c46eedec0efb24d0a9974b1c7fcabf8cfa66.zip
Set a starred_at field when an entry is starred.
This date is used to sort starred entries. Can not use Entry::timestamps method otherwise starred_at will be updated each time entry is updated. Add an updateStar method into Entry class A migration script has been added in order to set starred_at field.
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index bc1b6f92..6db97731 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -361,7 +361,7 @@ class EntryRestController extends WallabagRestController
361 } 361 }
362 362
363 if (null !== $data['isStarred']) { 363 if (null !== $data['isStarred']) {
364 $entry->setStarred((bool) $data['isStarred']); 364 $entry->updateStar((bool) $data['isStarred']);
365 } 365 }
366 366
367 if (!empty($data['tags'])) { 367 if (!empty($data['tags'])) {
@@ -464,7 +464,7 @@ class EntryRestController extends WallabagRestController
464 } 464 }
465 465
466 if (null !== $data['isStarred']) { 466 if (null !== $data['isStarred']) {
467 $entry->setStarred((bool) $data['isStarred']); 467 $entry->updateStar((bool) $data['isStarred']);
468 } 468 }
469 469
470 if (!empty($data['tags'])) { 470 if (!empty($data['tags'])) {