X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FWallabagV1Import.php;h=1d773d3bb58e2094ac057c490121c5dc9883479d;hb=fe8b37c137adbe036f58616c15dbcffd07dd2cd4;hp=05bdb4014239bc1535619e0aa1f76fd016ce11aa;hpb=c2656f96d4776c86b13d8a4c93a78ee7c4d3824c;p=github%2Fwallabag%2Fwallabag.git 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);