wallabag/src/Wallabag/ImportBundle/Import/WallabagV2Import.php

54 lines
1,008 B
PHP
Raw Normal View History

<?php
namespace Wallabag\ImportBundle\Import;
class WallabagV2Import extends WallabagImport
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'wallabag v2';
}
/**
* {@inheritdoc}
*/
public function getUrl()
{
return 'import_wallabag_v2';
}
/**
* {@inheritdoc}
*/
public function getDescription()
{
return 'import.wallabag_v2.description';
}
/**
* {@inheritdoc}
*/
2016-09-04 19:49:21 +00:00
protected function prepareEntry($entry = [])
{
return [
'html' => $entry['content'],
'content_type' => $entry['mimetype'],
'is_archived' => (int) ($entry['is_archived'] || $this->markAsRead),
'is_starred' => (int) $entry['is_starred'],
] + $entry;
}
2016-09-04 19:49:21 +00:00
2016-09-05 05:50:10 +00:00
/**
* {@inheritdoc}
*/
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
}
}