aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-02-12 15:59:13 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-03-03 10:03:28 +0100
commitfe8b37c137adbe036f58616c15dbcffd07dd2cd4 (patch)
treea0d6b5db7867ae7d1600e74b5b193dfaf8375125 /src/Wallabag/ImportBundle/Import/WallabagV1Import.php
parent7d12fd06288d71bd0f939ab34cfe2c0d881576e8 (diff)
downloadwallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.tar.gz
wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.tar.zst
wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.zip
Mark all imported articles as read
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV1Import.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV1Import.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
index 05bdb401..1d773d3b 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
@@ -19,6 +19,7 @@ class WallabagV1Import implements ImportInterface
19 protected $skippedEntries = 0; 19 protected $skippedEntries = 0;
20 protected $importedEntries = 0; 20 protected $importedEntries = 0;
21 protected $filepath; 21 protected $filepath;
22 protected $markAsRead;
22 23
23 public function __construct(EntityManager $em, ContentProxy $contentProxy) 24 public function __construct(EntityManager $em, ContentProxy $contentProxy)
24 { 25 {
@@ -121,6 +122,18 @@ class WallabagV1Import implements ImportInterface
121 } 122 }
122 123
123 /** 124 /**
125 * Set whether articles must be all marked as read.
126 *
127 * @param bool $markAsRead
128 */
129 public function setMarkAsRead($markAsRead)
130 {
131 $this->markAsRead = $markAsRead;
132
133 return $this;
134 }
135
136 /**
124 * @param $entries 137 * @param $entries
125 */ 138 */
126 protected function parseEntries($entries) 139 protected function parseEntries($entries)
@@ -160,7 +173,7 @@ class WallabagV1Import implements ImportInterface
160 ); 173 );
161 } 174 }
162 175
163 $entry->setArchived($importedEntry['is_read']); 176 $entry->setArchived($importedEntry['is_read'] || $this->markAsRead);
164 $entry->setStarred($importedEntry['is_fav']); 177 $entry->setStarred($importedEntry['is_fav']);
165 178
166 $this->em->persist($entry); 179 $this->em->persist($entry);