3 namespace Wallabag\ImportBundle\Import
;
5 class WallabagV2Import
extends WallabagImport
10 public function getName()
18 public function getUrl()
20 return 'import_wallabag_v2';
26 public function getDescription()
28 return 'import.wallabag_v2.description';
34 protected function prepareEntry($entry = [])
37 'html' => $entry['content'],
38 'content_type' => $entry['mimetype'],
39 'is_archived' => ($entry['is_archived'] || $this->markAsRead
),
43 protected function parseEntriesForProducer($entries)
45 foreach ($entries as $importedEntry) {
46 // set userId for the producer (it won't know which user is connected)
47 $importedEntry['userId'] = $this->user
->getId();
49 if ($this->markAsRead
) {
50 $importedEntry['is_archived'] = 1;
53 ++
$this->importedEntries
;
55 $this->producer
->publish(json_encode($importedEntry));