]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/ImportBundle/Import/ChromeImport.php
bring chrome and firefox as separate imports
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / ChromeImport.php
CommitLineData
59201088
TC
1<?php
2
3namespace Wallabag\ImportBundle\Import;
4
5use Psr\Log\LoggerInterface;
6use Psr\Log\NullLogger;
7use Doctrine\ORM\EntityManager;
8use Wallabag\CoreBundle\Entity\Entry;
9use Wallabag\UserBundle\Entity\User;
10use Wallabag\CoreBundle\Helper\ContentProxy;
11
12class ChromeImport extends BrowserImport
13{
14 protected $filepath;
15
16 /**
17 * {@inheritdoc}
18 */
19 public function getName()
20 {
21 return 'Chrome';
22 }
23
24 /**
25 * {@inheritdoc}
26 */
27 public function getUrl()
28 {
29 return 'import_chrome';
30 }
31
32 /**
33 * {@inheritdoc}
34 */
35 public function getDescription()
36 {
37 return 'import.chrome.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}