]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/ChromeImport.php
Move prepareEntry to dedicated place
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / ChromeImport.php
index 60602a1bdecbda0a96bb61b5a715f6cbdf5d32a0..d7620bcb76139676611610bc92a6fcdc7437072b 100644 (file)
@@ -29,4 +29,25 @@ class ChromeImport extends BrowserImport
     {
         return 'import.chrome.description';
     }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function prepareEntry(array $entry = [])
+    {
+        $data = [
+            'title' => $entry['name'],
+            'html' => '',
+            'url' => $entry['url'],
+            'is_archived' => $this->markAsRead,
+            'tags' => '',
+            'created_at' => substr($entry['date_added'], 0, 10),
+        ];
+
+        if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
+            $data['tags'] = $entry['tags'];
+        }
+
+        return $data;
+    }
 }