diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-05 07:50:10 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 21:58:55 +0200 |
commit | 3849a9f3231c0109c87af085452c3ac5e4aed303 (patch) | |
tree | d5b8946a196f98aa438e7a39568b40af4952712e /src/Wallabag/ImportBundle/Import/WallabagV1Import.php | |
parent | 02f64895728fe9aee2c696a627e0bbe27a24faf2 (diff) | |
download | wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.tar.gz wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.tar.zst wallabag-3849a9f3231c0109c87af085452c3ac5e4aed303.zip |
Some cleanup & refactor
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV1Import.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 86734652..292b72a7 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php | |||
@@ -57,19 +57,13 @@ class WallabagV1Import extends WallabagImport | |||
57 | return $data; | 57 | return $data; |
58 | } | 58 | } |
59 | 59 | ||
60 | protected function parseEntriesForProducer($entries) | 60 | /** |
61 | * {@inheritdoc} | ||
62 | */ | ||
63 | protected function setEntryAsRead(array $importedEntry) | ||
61 | { | 64 | { |
62 | foreach ($entries as $importedEntry) { | 65 | $importedEntry['is_read'] = 1; |
63 | // set userId for the producer (it won't know which user is connected) | ||
64 | $importedEntry['userId'] = $this->user->getId(); | ||
65 | 66 | ||
66 | if ($this->markAsRead) { | 67 | return $importedEntry; |
67 | $importedEntry['is_read'] = 1; | ||
68 | } | ||
69 | |||
70 | ++$this->importedEntries; | ||
71 | |||
72 | $this->producer->publish(json_encode($importedEntry)); | ||
73 | } | ||
74 | } | 68 | } |
75 | } | 69 | } |