aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/PocketImport.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/PocketImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 5dfd098c..238ddbd1 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -22,6 +22,7 @@ class PocketImport implements ImportInterface
22 private $consumerKey; 22 private $consumerKey;
23 private $skippedEntries = 0; 23 private $skippedEntries = 0;
24 private $importedEntries = 0; 24 private $importedEntries = 0;
25 private $markAsRead;
25 protected $accessToken; 26 protected $accessToken;
26 27
27 public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig) 28 public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig)
@@ -124,6 +125,26 @@ class PocketImport implements ImportInterface
124 } 125 }
125 126
126 /** 127 /**
128 * Set whether articles must be all marked as read.
129 *
130 * @param bool $markAsRead
131 */
132 public function setMarkAsRead($markAsRead)
133 {
134 $this->markAsRead = $markAsRead;
135
136 return $this;
137 }
138
139 /**
140 * Get whether articles must be all marked as read.
141 */
142 public function getRead()
143 {
144 return $this->markAsRead;
145 }
146
147 /**
127 * {@inheritdoc} 148 * {@inheritdoc}
128 */ 149 */
129 public function import() 150 public function import()
@@ -201,7 +222,7 @@ class PocketImport implements ImportInterface
201 $entry = $this->contentProxy->updateEntry($entry, $url); 222 $entry = $this->contentProxy->updateEntry($entry, $url);
202 223
203 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted 224 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
204 if ($pocketEntry['status'] == 1) { 225 if ($pocketEntry['status'] == 1 || $this->markAsRead) {
205 $entry->setArchived(true); 226 $entry->setArchived(true);
206 } 227 }
207 228