]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | namespace Wallabag\ImportBundle\Import; | |
4 | ||
5 | use Psr\Log\LoggerInterface; | |
6 | use Psr\Log\NullLogger; | |
7 | use Doctrine\ORM\EntityManager; | |
8 | use Wallabag\CoreBundle\Entity\Entry; | |
9 | use Wallabag\UserBundle\Entity\User; | |
10 | use Wallabag\CoreBundle\Helper\ContentProxy; | |
11 | ||
12 | class FirefoxImport extends BrowserImport | |
13 | { | |
14 | protected $filepath; | |
15 | ||
16 | /** | |
17 | * {@inheritdoc} | |
18 | */ | |
19 | public function getName() | |
20 | { | |
21 | return 'Firefox'; | |
22 | } | |
23 | ||
24 | /** | |
25 | * {@inheritdoc} | |
26 | */ | |
27 | public function getUrl() | |
28 | { | |
29 | return 'import_firefox'; | |
30 | } | |
31 | ||
32 | /** | |
33 | * {@inheritdoc} | |
34 | */ | |
35 | public function getDescription() | |
36 | { | |
37 | return 'import.firefox.description'; | |
38 | } | |
39 | ||
40 | /** | |
41 | * {@inheritdoc} | |
42 | */ | |
43 | protected function prepareEntry($entry = []) | |
44 | { | |
45 | $data = [ | |
46 | 'title' => $entry['name'], | |
47 | 'html' => '', | |
48 | 'url' => $entry['url'], | |
49 | 'is_archived' => $this->markAsRead, | |
50 | 'tags' => '', | |
51 | 'created_at' => $entry['date_added'], | |
52 | ]; | |
53 | ||
54 | if (array_key_exists('tags', $entry) && $entry['tags'] != '') { | |
55 | $data['tags'] = $entry['tags']; | |
56 | } | |
57 | ||
58 | return $data; | |
59 | } | |
60 | ||
61 | ||
62 | /** | |
63 | * {@inheritdoc} | |
64 | */ | |
65 | protected function setEntryAsRead(array $importedEntry) | |
66 | { | |
67 | $importedEntry['is_archived'] = 1; | |
68 | ||
69 | return $importedEntry; | |
70 | } | |
71 | } |