]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/WallabagImport.php
Merge pull request #1 from wallabag/master
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagImport.php
index c64ccd64d196095ce8b9e3f913c4f856075f0fa3..75a28fbf58e0242ec2f0f617266954b5ef83b5ed 100644 (file)
@@ -86,6 +86,18 @@ abstract class WallabagImport extends AbstractImport
         return $this;
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function validateEntry(array $importedEntry)
+    {
+        if (empty($importedEntry['url'])) {
+            return false;
+        }
+
+        return true;
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -110,7 +122,7 @@ abstract class WallabagImport extends AbstractImport
         // update entry with content (in case fetching failed, the given entry will be return)
         $this->fetchContent($entry, $data['url'], $data);
 
-        if (array_key_exists('tags', $data)) {
+        if (\array_key_exists('tags', $data)) {
             $this->tagsAssigner->assignTagsToEntry(
                 $entry,
                 $data['tags'],
@@ -122,7 +134,7 @@ abstract class WallabagImport extends AbstractImport
             $entry->setPreviewPicture($importedEntry['preview_picture']);
         }
 
-        $entry->setArchived($data['is_archived']);
+        $entry->updateArchived($data['is_archived']);
         $entry->setStarred($data['is_starred']);
 
         if (!empty($data['created_at'])) {