wallabag/src/Import/WallabagV2Import.php

41 lines
858 B
PHP
Raw Permalink Normal View History

<?php
2024-02-19 00:30:12 +00:00
namespace Wallabag\Import;
class WallabagV2Import extends WallabagImport
{
public function getName()
{
return 'wallabag v2';
}
public function getUrl()
{
return 'import_wallabag_v2';
}
public function getDescription()
{
return 'import.wallabag_v2.description';
}
2016-09-04 19:49:21 +00:00
protected function prepareEntry($entry = [])
{
return [
'html' => $entry['content'],
'headers' => [
'content-type' => $entry['mimetype'],
],
2017-05-30 18:15:41 +00:00
'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
'is_starred' => (bool) $entry['is_starred'],
] + $entry;
}
2016-09-04 19:49:21 +00:00
2016-09-05 05:50:10 +00:00
protected function setEntryAsRead(array $importedEntry)
2016-09-04 19:49:21 +00:00
{
2016-09-05 05:50:10 +00:00
$importedEntry['is_archived'] = 1;
2016-09-04 19:49:21 +00:00
2016-09-05 05:50:10 +00:00
return $importedEntry;
2016-09-04 19:49:21 +00:00
}
}