X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FPocketImport.php;h=4499ce6993563f41d1eccfddbf1b22f1743cb9e7;hb=2baca964f38e658f60c8b9f81a9db289ba85bd0d;hp=5dfd098caf5e0d6d01f4bbcaa7d2cba929c5c0c5;hpb=12b5a8cea12c7c8b10ede7fd00d1f07ca06b1033;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 5dfd098c..4499ce69 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -22,6 +22,7 @@ class PocketImport implements ImportInterface private $consumerKey; private $skippedEntries = 0; private $importedEntries = 0; + private $markAsRead; protected $accessToken; public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig) @@ -59,7 +60,7 @@ class PocketImport implements ImportInterface */ public function getDescription() { - return 'This importer will import all your Pocket data. Pocket doesn\'t allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.'; + return 'import.pocket.description'; } /** @@ -123,6 +124,26 @@ class PocketImport implements ImportInterface return true; } + /** + * Set whether articles must be all marked as read. + * + * @param bool $markAsRead + */ + public function setMarkAsRead($markAsRead) + { + $this->markAsRead = $markAsRead; + + return $this; + } + + /** + * Get whether articles must be all marked as read. + */ + public function getMarkAsRead() + { + return $this->markAsRead; + } + /** * {@inheritdoc} */ @@ -201,7 +222,7 @@ class PocketImport implements ImportInterface $entry = $this->contentProxy->updateEntry($entry, $url); // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted - if ($pocketEntry['status'] == 1) { + if ($pocketEntry['status'] == 1 || $this->markAsRead) { $entry->setArchived(true); }