]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/ImportBundle/Import/WallabagV2Import.php
Merge pull request #3959 from wallabag/mig-tag-collation
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagV2Import.php
1 <?php
2
3 namespace Wallabag\ImportBundle\Import;
4
5 class WallabagV2Import extends WallabagImport
6 {
7 /**
8 * {@inheritdoc}
9 */
10 public function getName()
11 {
12 return 'wallabag v2';
13 }
14
15 /**
16 * {@inheritdoc}
17 */
18 public function getUrl()
19 {
20 return 'import_wallabag_v2';
21 }
22
23 /**
24 * {@inheritdoc}
25 */
26 public function getDescription()
27 {
28 return 'import.wallabag_v2.description';
29 }
30
31 /**
32 * {@inheritdoc}
33 */
34 protected function prepareEntry($entry = [])
35 {
36 return [
37 'html' => $entry['content'],
38 'headers' => [
39 'content-type' => $entry['mimetype'],
40 ],
41 'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
42 'is_starred' => (bool) $entry['is_starred'],
43 ] + $entry;
44 }
45
46 /**
47 * {@inheritdoc}
48 */
49 protected function setEntryAsRead(array $importedEntry)
50 {
51 $importedEntry['is_archived'] = 1;
52
53 return $importedEntry;
54 }
55 }