aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/PocketImport.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-09-05 07:50:10 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-11 21:58:55 +0200
commit3849a9f3231c0109c87af085452c3ac5e4aed303 (patch)
treed5b8946a196f98aa438e7a39568b40af4952712e /src/Wallabag/ImportBundle/Import/PocketImport.php
parent02f64895728fe9aee2c696a627e0bbe27a24faf2 (diff)
downloadwallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.tar.gz
wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.tar.zst
wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.zip
Some cleanup & refactor
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/PocketImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 06a31813..5850deba 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -29,7 +29,7 @@ class PocketImport extends AbstractImport
29 } 29 }
30 30
31 /** 31 /**
32 * Only used for test purpose 32 * Only used for test purpose.
33 * 33 *
34 * @return string 34 * @return string
35 */ 35 */
@@ -258,24 +258,12 @@ class PocketImport extends AbstractImport
258 } 258 }
259 259
260 /** 260 /**
261 * Faster parse entries for Producer. 261 * {@inheritdoc}
262 * We don't care to make check at this time. They'll be done by the consumer.
263 *
264 * @param array $entries
265 */ 262 */
266 public function parseEntriesForProducer($entries) 263 protected function setEntryAsRead(array $importedEntry)
267 { 264 {
268 foreach ($entries as $importedEntry) { 265 $importedEntry['status'] = 1;
269 // set userId for the producer (it won't know which user is connected)
270 $importedEntry['userId'] = $this->user->getId();
271
272 if ($this->markAsRead) {
273 $importedEntry['status'] = 1;
274 }
275 266
276 ++$this->importedEntries; 267 return $importedEntry;
277
278 $this->producer->publish(json_encode($importedEntry));
279 }
280 } 268 }
281} 269}