]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/PocketImport.php
Merge pull request #1583 from wallabag/v2-fix-delete
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / PocketImport.php
index b1c5bb0013d825e8ca8ecfa4135eef4b17fba588..72b9047c8fdc3acc39267b67a4af11adc31f2634 100644 (file)
@@ -18,10 +18,12 @@ class PocketImport implements ImportInterface
     private $em;
     private $contentProxy;
     private $logger;
+    private $client;
     private $consumerKey;
     private $skippedEntries = 0;
     private $importedEntries = 0;
     protected $accessToken;
+    private $translator;
 
     public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey)
     {
@@ -58,7 +60,7 @@ class PocketImport implements ImportInterface
      */
     public function getDescription()
     {
-        return 'This importer will import all your <a href="https://getpocket.com">Pocket</a> data. Pocket doesn\'t allow us to retrieve content from their service, so the readable content of each article will be re-fetched by Wallabag.';
+        return 'This importer will import all your Pocket data. Pocket doesn\'t allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.';
     }
 
     /**
@@ -184,13 +186,14 @@ class PocketImport implements ImportInterface
             $label = trim($tag['tag']);
             $tagEntity = $this->em
                 ->getRepository('WallabagCoreBundle:Tag')
-                ->findOneByLabelAndUserId($label, $this->user->getId());
+                ->findOneByLabel($label);
 
             if (is_object($tagEntity)) {
                 $entry->addTag($tagEntity);
             } else {
-                $newTag = new Tag($this->user);
+                $newTag = new Tag();
                 $newTag->setLabel($label);
+
                 $entry->addTag($newTag);
             }
             $this->em->flush();
@@ -211,7 +214,7 @@ class PocketImport implements ImportInterface
 
             $existingEntry = $this->em
                 ->getRepository('WallabagCoreBundle:Entry')
-                ->existByUrlAndUserId($url, $this->user->getId());
+                ->findByUrlAndUserId($url, $this->user->getId());
 
             if (false !== $existingEntry) {
                 ++$this->skippedEntries;
@@ -254,7 +257,7 @@ class PocketImport implements ImportInterface
 
             // flush every 20 entries
             if (($i % 20) === 0) {
-                $em->flush();
+                $this->em->flush();
             }
             ++$i;
         }