diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/ReadabilityImport.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/ReadabilityImport.php | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 18a6631a..64ef62bf 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php | |||
@@ -3,7 +3,6 @@ | |||
3 | namespace Wallabag\ImportBundle\Import; | 3 | namespace Wallabag\ImportBundle\Import; |
4 | 4 | ||
5 | use Wallabag\CoreBundle\Entity\Entry; | 5 | use Wallabag\CoreBundle\Entity\Entry; |
6 | use Wallabag\UserBundle\Entity\User; | ||
7 | 6 | ||
8 | class ReadabilityImport extends AbstractImport | 7 | class ReadabilityImport extends AbstractImport |
9 | { | 8 | { |
@@ -136,31 +135,12 @@ class ReadabilityImport extends AbstractImport | |||
136 | } | 135 | } |
137 | 136 | ||
138 | /** | 137 | /** |
139 | * Faster parse entries for Producer. | 138 | * {@inheritdoc} |
140 | * We don't care to make check at this time. They'll be done by the consumer. | ||
141 | * | ||
142 | * @param array $entries | ||
143 | */ | 139 | */ |
144 | protected function parseEntriesForProducer($entries) | 140 | protected function setEntryAsRead(array $importedEntry) |
145 | { | 141 | { |
146 | foreach ($entries as $importedEntry) { | 142 | $importedEntry['archive'] = 1; |
147 | // set userId for the producer (it won't know which user is connected) | ||
148 | $importedEntry['userId'] = $this->user->getId(); | ||
149 | |||
150 | if ($this->markAsRead) { | ||
151 | $importedEntry['archive'] = 1; | ||
152 | } | ||
153 | |||
154 | ++$this->importedEntries; | ||
155 | |||
156 | // flush every 20 entries | ||
157 | if (($i % 20) === 0) { | ||
158 | $this->em->flush(); | ||
159 | } | ||
160 | ++$i; | ||
161 | } | ||
162 | 143 | ||
163 | $this->em->flush(); | 144 | return $importedEntry; |
164 | $this->em->clear(); | ||
165 | } | 145 | } |
166 | } | 146 | } |