]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/ImportBundle/Import/ChromeImport.php
Merge pull request #2724 from Simounet/fix/reading-time
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / ChromeImport.php
CommitLineData
59201088
TC
1<?php
2
3namespace Wallabag\ImportBundle\Import;
4
59201088
TC
5class ChromeImport extends BrowserImport
6{
7 protected $filepath;
8
9 /**
10 * {@inheritdoc}
11 */
12 public function getName()
13 {
14 return 'Chrome';
15 }
16
17 /**
18 * {@inheritdoc}
19 */
20 public function getUrl()
21 {
22 return 'import_chrome';
23 }
24
25 /**
26 * {@inheritdoc}
27 */
28 public function getDescription()
29 {
30 return 'import.chrome.description';
31 }
990adfb3
JB
32
33 /**
34 * {@inheritdoc}
35 */
36 protected function prepareEntry(array $entry = [])
37 {
38 $data = [
39 'title' => $entry['name'],
36e6ef52 40 'html' => false,
990adfb3 41 'url' => $entry['url'],
bb98fede
NL
42 'is_archived' => (int) $this->markAsRead,
43 'is_starred' => false,
990adfb3
JB
44 'tags' => '',
45 'created_at' => substr($entry['date_added'], 0, 10),
46 ];
47
48 if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
49 $data['tags'] = $entry['tags'];
50 }
51
52 return $data;
53 }
59201088 54}