]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/ImportBundle/Import/WallabagV2Import.php
And of course it doesn't work for SQLite
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagV2Import.php
CommitLineData
6785f4aa
NL
1<?php
2
3namespace Wallabag\ImportBundle\Import;
4
b787a775 5class WallabagV2Import extends WallabagImport
6785f4aa
NL
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 {
0d42217e 28 return 'import.wallabag_v2.description';
6785f4aa
NL
29 }
30
31 /**
b787a775 32 * {@inheritdoc}
6785f4aa 33 */
c98db1b6 34 protected function prepareEntry($entry = [])
6785f4aa 35 {
b787a775
JB
36 return [
37 'html' => $entry['content'],
38 'content_type' => $entry['mimetype'],
bb98fede
NL
39 'is_archived' => (int) ($entry['is_archived'] || $this->markAsRead),
40 'is_starred' => false,
b787a775 41 ] + $entry;
6785f4aa 42 }
c98db1b6 43
3849a9f3
JB
44 /**
45 * {@inheritdoc}
46 */
47 protected function setEntryAsRead(array $importedEntry)
c98db1b6 48 {
3849a9f3 49 $importedEntry['is_archived'] = 1;
c98db1b6 50
3849a9f3 51 return $importedEntry;
c98db1b6 52 }
6785f4aa 53}