diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagImport.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/WallabagImport.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index c64ccd64..75a28fbf 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php | |||
@@ -89,6 +89,18 @@ abstract class WallabagImport extends AbstractImport | |||
89 | /** | 89 | /** |
90 | * {@inheritdoc} | 90 | * {@inheritdoc} |
91 | */ | 91 | */ |
92 | public function validateEntry(array $importedEntry) | ||
93 | { | ||
94 | if (empty($importedEntry['url'])) { | ||
95 | return false; | ||
96 | } | ||
97 | |||
98 | return true; | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * {@inheritdoc} | ||
103 | */ | ||
92 | public function parseEntry(array $importedEntry) | 104 | public function parseEntry(array $importedEntry) |
93 | { | 105 | { |
94 | $existingEntry = $this->em | 106 | $existingEntry = $this->em |
@@ -110,7 +122,7 @@ abstract class WallabagImport extends AbstractImport | |||
110 | // update entry with content (in case fetching failed, the given entry will be return) | 122 | // update entry with content (in case fetching failed, the given entry will be return) |
111 | $this->fetchContent($entry, $data['url'], $data); | 123 | $this->fetchContent($entry, $data['url'], $data); |
112 | 124 | ||
113 | if (array_key_exists('tags', $data)) { | 125 | if (\array_key_exists('tags', $data)) { |
114 | $this->tagsAssigner->assignTagsToEntry( | 126 | $this->tagsAssigner->assignTagsToEntry( |
115 | $entry, | 127 | $entry, |
116 | $data['tags'], | 128 | $data['tags'], |
@@ -122,7 +134,7 @@ abstract class WallabagImport extends AbstractImport | |||
122 | $entry->setPreviewPicture($importedEntry['preview_picture']); | 134 | $entry->setPreviewPicture($importedEntry['preview_picture']); |
123 | } | 135 | } |
124 | 136 | ||
125 | $entry->setArchived($data['is_archived']); | 137 | $entry->updateArchived($data['is_archived']); |
126 | $entry->setStarred($data['is_starred']); | 138 | $entry->setStarred($data['is_starred']); |
127 | 139 | ||
128 | if (!empty($data['created_at'])) { | 140 | if (!empty($data['created_at'])) { |