]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | namespace Wallabag\ImportBundle\Import; | |
4 | ||
5 | class FirefoxImport extends BrowserImport | |
6 | { | |
7 | protected $filepath; | |
8 | ||
9 | /** | |
10 | * {@inheritdoc} | |
11 | */ | |
12 | public function getName() | |
13 | { | |
14 | return 'Firefox'; | |
15 | } | |
16 | ||
17 | /** | |
18 | * {@inheritdoc} | |
19 | */ | |
20 | public function getUrl() | |
21 | { | |
22 | return 'import_firefox'; | |
23 | } | |
24 | ||
25 | /** | |
26 | * {@inheritdoc} | |
27 | */ | |
28 | public function getDescription() | |
29 | { | |
30 | return 'import.firefox.description'; | |
31 | } | |
32 | ||
33 | /** | |
34 | * {@inheritdoc} | |
35 | */ | |
36 | protected function prepareEntry(array $entry = []) | |
37 | { | |
38 | $data = [ | |
39 | 'title' => $entry['title'], | |
40 | 'html' => '', | |
41 | 'url' => $entry['uri'], | |
42 | 'is_archived' => $this->markAsRead, | |
43 | 'tags' => '', | |
44 | 'created_at' => substr($entry['dateAdded'], 0, 10), | |
45 | ]; | |
46 | ||
47 | if (array_key_exists('tags', $entry) && $entry['tags'] != '') { | |
48 | $data['tags'] = $entry['tags']; | |
49 | } | |
50 | ||
51 | return $data; | |
52 | } | |
53 | } |