]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/ReadabilityImport.php
Some cleanup & refactor
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / ReadabilityImport.php
index 18a6631a02dbfb993f66abfde522831f8aec2b02..64ef62bfb77ed79953a4448d51a9510f0812dfd7 100644 (file)
@@ -3,7 +3,6 @@
 namespace Wallabag\ImportBundle\Import;
 
 use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\UserBundle\Entity\User;
 
 class ReadabilityImport extends AbstractImport
 {
@@ -136,31 +135,12 @@ class ReadabilityImport extends AbstractImport
     }
 
     /**
-     * Faster parse entries for Producer.
-     * We don't care to make check at this time. They'll be done by the consumer.
-     *
-     * @param array $entries
+     * {@inheritdoc}
      */
-    protected function parseEntriesForProducer($entries)
+    protected function setEntryAsRead(array $importedEntry)
     {
-        foreach ($entries as $importedEntry) {
-            // set userId for the producer (it won't know which user is connected)
-            $importedEntry['userId'] = $this->user->getId();
-
-            if ($this->markAsRead) {
-                $importedEntry['archive'] = 1;
-            }
-
-            ++$this->importedEntries;
-
-            // flush every 20 entries
-            if (($i % 20) === 0) {
-                $this->em->flush();
-            }
-            ++$i;
-        }
+        $importedEntry['archive'] = 1;
 
-        $this->em->flush();
-        $this->em->clear();
+        return $importedEntry;
     }
 }