private $em;
private $contentProxy;
private $logger;
+ private $client;
private $consumerKey;
private $skippedEntries = 0;
private $importedEntries = 0;
return 'Pocket';
}
+ /**
+ * {@inheritdoc}
+ */
+ public function getUrl()
+ {
+ return 'import_pocket';
+ }
+
/**
* {@inheritdoc}
*/
public function getDescription()
{
- return 'This importer will import all your <a href="https://getpocket.com">Pocket</a> data.';
+ return 'This importer will import all your <a href="https://getpocket.com">Pocket</a> data. Pocket doesn\'t allow us to retrieve content from their service, so the readable content of each article will be re-fetched by Wallabag.';
}
/**
$label = trim($tag['tag']);
$tagEntity = $this->em
->getRepository('WallabagCoreBundle:Tag')
- ->findOneByLabelAndUserId($label, $this->user->getId());
+ ->findOneByLabel($label);
if (is_object($tagEntity)) {
$entry->addTag($tagEntity);
} else {
- $newTag = new Tag($this->user);
+ $newTag = new Tag();
$newTag->setLabel($label);
+
$entry->addTag($newTag);
}
$this->em->flush();
*/
private function parseEntries($entries)
{
+ $i = 1;
+
foreach ($entries as $pocketEntry) {
$url = isset($pocketEntry['resolved_url']) && $pocketEntry['resolved_url'] != '' ? $pocketEntry['resolved_url'] : $pocketEntry['given_url'];
$this->em->persist($entry);
++$this->importedEntries;
+
+ // flush every 20 entries
+ if (($i % 20) === 0) {
+ $this->em->flush();
+ }
+ ++$i;
}
$this->em->flush();