diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2019-11-15 16:38:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-15 16:38:30 +0100 |
commit | 069229e19cbb02d83b94b8356dfa2e28901aa1b6 (patch) | |
tree | 02717c536865a32983017faf5ec195f0e7148fc9 /src/Wallabag/ImportBundle/Import/ElcuratorImport.php | |
parent | 3c5aa05311d057c8fed83f085e6fb6ecc874fca4 (diff) | |
parent | 958e77e6a7c779de11f0f070b70c861c246a959f (diff) | |
download | wallabag-069229e19cbb02d83b94b8356dfa2e28901aa1b6.tar.gz wallabag-069229e19cbb02d83b94b8356dfa2e28901aa1b6.tar.zst wallabag-069229e19cbb02d83b94b8356dfa2e28901aa1b6.zip |
Merge pull request #4175 from wallabag/import-elcurator
Added elCurator import
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/ElcuratorImport.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/ElcuratorImport.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Import/ElcuratorImport.php b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php new file mode 100644 index 00000000..d1281613 --- /dev/null +++ b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php | |||
@@ -0,0 +1,54 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ImportBundle\Import; | ||
4 | |||
5 | class ElcuratorImport extends WallabagImport | ||
6 | { | ||
7 | /** | ||
8 | * {@inheritdoc} | ||
9 | */ | ||
10 | public function getName() | ||
11 | { | ||
12 | return 'elcurator'; | ||
13 | } | ||
14 | |||
15 | /** | ||
16 | * {@inheritdoc} | ||
17 | */ | ||
18 | public function getUrl() | ||
19 | { | ||
20 | return 'import_elcurator'; | ||
21 | } | ||
22 | |||
23 | /** | ||
24 | * {@inheritdoc} | ||
25 | */ | ||
26 | public function getDescription() | ||
27 | { | ||
28 | return 'import.elcurator.description'; | ||
29 | } | ||
30 | |||
31 | /** | ||
32 | * {@inheritdoc} | ||
33 | */ | ||
34 | protected function prepareEntry($entry = []) | ||
35 | { | ||
36 | return [ | ||
37 | 'url' => $entry['url'], | ||
38 | 'title' => $entry['title'], | ||
39 | 'created_at' => $entry['created_at'], | ||
40 | 'is_archived' => 0, | ||
41 | 'is_starred' => $entry['is_saved'], | ||
42 | ] + $entry; | ||
43 | } | ||
44 | |||
45 | /** | ||
46 | * {@inheritdoc} | ||
47 | */ | ||
48 | protected function setEntryAsRead(array $importedEntry) | ||
49 | { | ||
50 | $importedEntry['is_archived'] = 1; | ||
51 | |||
52 | return $importedEntry; | ||
53 | } | ||
54 | } | ||