namespace Wallabag\ImportBundle\Import;
-use Psr\Log\NullLogger;
-use Doctrine\ORM\EntityManager;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Helper\ContentProxy;
class PocketImport extends AbstractImport
{
const NB_ELEMENTS = 5000;
- public function __construct(EntityManager $em, ContentProxy $contentProxy)
- {
- $this->em = $em;
- $this->contentProxy = $contentProxy;
- $this->logger = new NullLogger();
- }
-
/**
* Only used for test purpose.
*
$entry->setUrl($url);
// update entry with content (in case fetching failed, the given entry will be return)
- $entry = $this->fetchContent($entry, $url);
+ $this->fetchContent($entry, $url);
// 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
$entry->setArchived($importedEntry['status'] == 1 || $this->markAsRead);
}
if (isset($importedEntry['tags']) && !empty($importedEntry['tags'])) {
- $this->contentProxy->assignTagsToEntry(
+ $this->tagsAssigner->assignTagsToEntry(
$entry,
array_keys($importedEntry['tags']),
$this->em->getUnitOfWork()->getScheduledEntityInsertions()