]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/PocketImport.php
Merge pull request #3858 from wallabag/bump-ocramius
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / PocketImport.php
index c1b35b7ef028a0e261d9a072e867246eca4816eb..f2e5918343a6dc05fa9b6010b09cd799738739d5 100644 (file)
@@ -168,6 +168,18 @@ class PocketImport extends AbstractImport
         $this->client = $client;
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function validateEntry(array $importedEntry)
+    {
+        if (empty($importedEntry['resolved_url']) && empty($importedEntry['given_url'])) {
+            return false;
+        }
+
+        return true;
+    }
+
     /**
      * {@inheritdoc}
      *
@@ -194,7 +206,7 @@ class PocketImport extends AbstractImport
         $this->fetchContent($entry, $url);
 
         // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
-        $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead);
+        $entry->updateArchived(1 === $importedEntry['status'] || $this->markAsRead);
 
         // 0 or 1 - 1 If the item is starred
         $entry->setStarred(1 === $importedEntry['favorite']);