aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/ChromeImport.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-09-26 07:30:02 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-26 07:30:02 +0200
commit990adfb34c148e7cd28b9cb784cf2b7388caae8f (patch)
treef716810fa5f766bcdfa5af5bb9ba3b568c3517ca /src/Wallabag/ImportBundle/Import/ChromeImport.php
parent12d93e6896f2d99b6329b7979ee7b6d11e457c3a (diff)
downloadwallabag-990adfb34c148e7cd28b9cb784cf2b7388caae8f.tar.gz
wallabag-990adfb34c148e7cd28b9cb784cf2b7388caae8f.tar.zst
wallabag-990adfb34c148e7cd28b9cb784cf2b7388caae8f.zip
Move prepareEntry to dedicated place
Yeah first try was ugly, now each part are in the dedicated place. Also, the date is hardly truncated to 10 chars because Firefox date are 16 chars long and Chrome are 17 chars long. So instead of divised them by a huge number, I prefer to truncate them.
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/ChromeImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/ChromeImport.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php
index 60602a1b..d7620bcb 100644
--- a/src/Wallabag/ImportBundle/Import/ChromeImport.php
+++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php
@@ -29,4 +29,25 @@ class ChromeImport extends BrowserImport
29 { 29 {
30 return 'import.chrome.description'; 30 return 'import.chrome.description';
31 } 31 }
32
33 /**
34 * {@inheritdoc}
35 */
36 protected function prepareEntry(array $entry = [])
37 {
38 $data = [
39 'title' => $entry['name'],
40 'html' => '',
41 'url' => $entry['url'],
42 'is_archived' => $this->markAsRead,
43 'tags' => '',
44 'created_at' => substr($entry['date_added'], 0, 10),
45 ];
46
47 if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
48 $data['tags'] = $entry['tags'];
49 }
50
51 return $data;
52 }
32} 53}