diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/PocketImport.php | 24 | ||||
-rw-r--r-- | src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 1 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 5dfd098c..1cc03d5b 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) |
@@ -123,6 +124,27 @@ class PocketImport implements ImportInterface | |||
123 | return true; | 124 | return true; |
124 | } | 125 | } |
125 | 126 | ||
127 | |||
128 | /** | ||
129 | * Set whether articles must be all marked as read. | ||
130 | * | ||
131 | * @param bool $markAsRead | ||
132 | */ | ||
133 | public function setMarkAsRead($markAsRead) | ||
134 | { | ||
135 | $this->markAsRead = $markAsRead; | ||
136 | |||
137 | return $this; | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * Get whether articles must be all marked as read. | ||
142 | */ | ||
143 | public function getRead() | ||
144 | { | ||
145 | return $this->markAsRead; | ||
146 | } | ||
147 | |||
126 | /** | 148 | /** |
127 | * {@inheritdoc} | 149 | * {@inheritdoc} |
128 | */ | 150 | */ |
@@ -201,7 +223,7 @@ class PocketImport implements ImportInterface | |||
201 | $entry = $this->contentProxy->updateEntry($entry, $url); | 223 | $entry = $this->contentProxy->updateEntry($entry, $url); |
202 | 224 | ||
203 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted | 225 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted |
204 | if ($pocketEntry['status'] == 1) { | 226 | if ($pocketEntry['status'] == 1 | $this->markAsRead) { |
205 | $entry->setArchived(true); | 227 | $entry->setArchived(true); |
206 | } | 228 | } |
207 | 229 | ||
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 1d773d3b..9ea698f9 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php | |||
@@ -128,6 +128,7 @@ class WallabagV1Import implements ImportInterface | |||
128 | */ | 128 | */ |
129 | public function setMarkAsRead($markAsRead) | 129 | public function setMarkAsRead($markAsRead) |
130 | { | 130 | { |
131 | var_dump($markAsRead); | ||
131 | $this->markAsRead = $markAsRead; | 132 | $this->markAsRead = $markAsRead; |
132 | 133 | ||
133 | return $this; | 134 | return $this; |