]> 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 702da057a0b996b0e8b305f84b86db07c642eb81..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}
      */
@@ -108,10 +120,10 @@ abstract class WallabagImport extends AbstractImport
         $entry->setTitle($data['title']);
 
         // update entry with content (in case fetching failed, the given entry will be return)
-        $entry = $this->fetchContent($entry, $data['url'], $data);
+        $this->fetchContent($entry, $data['url'], $data);
 
-        if (array_key_exists('tags', $data)) {
-            $this->contentProxy->assignTagsToEntry(
+        if (\array_key_exists('tags', $data)) {
+            $this->tagsAssigner->assignTagsToEntry(
                 $entry,
                 $data['tags'],
                 $this->em->getUnitOfWork()->getScheduledEntityInsertions()
@@ -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'])) {