From fe8b37c137adbe036f58616c15dbcffd07dd2cd4 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 12 Feb 2016 15:59:13 +0100 Subject: Mark all imported articles as read --- src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/ImportBundle/Import/WallabagV1Import.php') 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 protected $skippedEntries = 0; protected $importedEntries = 0; protected $filepath; + protected $markAsRead; public function __construct(EntityManager $em, ContentProxy $contentProxy) { @@ -120,6 +121,18 @@ class WallabagV1Import implements ImportInterface return $this; } + /** + * Set whether articles must be all marked as read. + * + * @param bool $markAsRead + */ + public function setMarkAsRead($markAsRead) + { + $this->markAsRead = $markAsRead; + + return $this; + } + /** * @param $entries */ @@ -160,7 +173,7 @@ class WallabagV1Import implements ImportInterface ); } - $entry->setArchived($importedEntry['is_read']); + $entry->setArchived($importedEntry['is_read'] || $this->markAsRead); $entry->setStarred($importedEntry['is_fav']); $this->em->persist($entry); -- cgit v1.2.3