]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/ImportBundle/Import/WallabagV2Import.php
Merge remote-tracking branch 'origin/master' into 2.3
[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 'content_type' => $entry['mimetype'],
39 'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
40 'is_starred' => (bool) $entry['is_starred'],
41 ] + $entry;
42 }
43
44 /**
45 * {@inheritdoc}
46 */
47 protected function setEntryAsRead(array $importedEntry)
48 {
49 $importedEntry['is_archived'] = 1;
50
51 return $importedEntry;
52 }
53 }