aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/FirefoxImport.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-09-21 17:47:47 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-25 12:29:18 +0200
commit59201088b4fc13fd361238396f630dabd9bd1990 (patch)
tree2d4d5c2fbe7f007214c41f0c4ccba2f8d3d7ec8b /src/Wallabag/ImportBundle/Import/FirefoxImport.php
parentf7c55b38122cc593c2b58bb6425fca9d243b055e (diff)
downloadwallabag-59201088b4fc13fd361238396f630dabd9bd1990.tar.gz
wallabag-59201088b4fc13fd361238396f630dabd9bd1990.tar.zst
wallabag-59201088b4fc13fd361238396f630dabd9bd1990.zip
bring chrome and firefox as separate imports
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/FirefoxImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/FirefoxImport.php71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php
new file mode 100644
index 00000000..cbf10b87
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php
@@ -0,0 +1,71 @@
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 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}