2016-01-20 13:37:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wallabag\ImportBundle\Import;
|
|
|
|
|
2016-03-28 14:43:33 +00:00
|
|
|
class WallabagV2Import extends WallabagImport
|
2016-01-20 13:37:01 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return 'wallabag v2';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getUrl()
|
|
|
|
{
|
|
|
|
return 'import_wallabag_v2';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getDescription()
|
|
|
|
{
|
2016-03-09 07:59:08 +00:00
|
|
|
return 'import.wallabag_v2.description';
|
2016-01-20 13:37:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-03-28 14:43:33 +00:00
|
|
|
* {@inheritdoc}
|
2016-01-20 13:37:01 +00:00
|
|
|
*/
|
2016-03-28 14:43:33 +00:00
|
|
|
protected function prepareEntry($entry = [], $markAsRead = false)
|
2016-01-20 13:37:01 +00:00
|
|
|
{
|
2016-03-28 14:43:33 +00:00
|
|
|
return [
|
|
|
|
'html' => $entry['content'],
|
|
|
|
'content_type' => $entry['mimetype'],
|
|
|
|
'is_archived' => ($entry['is_archived'] || $markAsRead),
|
|
|
|
] + $entry;
|
2016-01-20 13:37:01 +00:00
|
|
|
}
|
|
|
|
}
|