aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/WallabagV2Import.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/WallabagV2Import.php
parent02f64895728fe9aee2c696a627e0bbe27a24faf2 (diff)
downloadwallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.tar.gz
wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.tar.zst
wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.zip
Some cleanup & refactor
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV2Import.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV2Import.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
index faf4236f..37c8ca14 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
@@ -40,19 +40,13 @@ class WallabagV2Import extends WallabagImport
40 ] + $entry; 40 ] + $entry;
41 } 41 }
42 42
43 protected function parseEntriesForProducer($entries) 43 /**
44 * {@inheritdoc}
45 */
46 protected function setEntryAsRead(array $importedEntry)
44 { 47 {
45 foreach ($entries as $importedEntry) { 48 $importedEntry['is_archived'] = 1;
46 // set userId for the producer (it won't know which user is connected)
47 $importedEntry['userId'] = $this->user->getId();
48
49 if ($this->markAsRead) {
50 $importedEntry['is_archived'] = 1;
51 }
52
53 ++$this->importedEntries;
54 49
55 $this->producer->publish(json_encode($importedEntry)); 50 return $importedEntry;
56 }
57 } 51 }
58} 52}