Files
wallabag/src/Wallabag/ImportBundle/Import/FirefoxImport.php

64 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Wallabag\ImportBundle\Import;
class FirefoxImport extends BrowserImport
{
protected $filepath;
/**
* {@inheritdoc}
*/
public function getName()
{
return 'Firefox';
}
/**
* {@inheritdoc}
*/
public function getUrl()
{
return 'import_firefox';
}
/**
* {@inheritdoc}
*/
public function getDescription()
{
return 'import.firefox.description';
}
/**
* {@inheritdoc}
*/
protected function prepareEntry($entry = [])
{
2016-09-21 18:00:08 +02:00
$data = [
'title' => $entry['name'],
'html' => '',
'url' => $entry['url'],
'is_archived' => $this->markAsRead,
'tags' => '',
'created_at' => $entry['date_added'],
];
2016-09-21 18:00:08 +02:00
if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
$data['tags'] = $entry['tags'];
}
2016-09-21 18:00:08 +02:00
return $data;
}
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry)
{
$importedEntry['is_archived'] = 1;
return $importedEntry;
}
}