use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Helper\ContentProxy;
-use Symfony\Component\Translation\TranslatorInterface;
+use Craue\ConfigBundle\Util\Config;
class PocketImport implements ImportInterface
{
protected $accessToken;
private $translator;
- public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey, TranslatorInterface $translator)
+ public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig)
{
$this->user = $tokenStorage->getToken()->getUser();
$this->em = $em;
$this->contentProxy = $contentProxy;
- $this->consumerKey = $consumerKey;
+ $this->consumerKey = $craueConfig->get('pocket_consumer_key');
$this->logger = new NullLogger();
- $this->translator = $translator;
}
public function setLogger(LoggerInterface $logger)
*/
public function getDescription()
{
- return $this->translator->trans("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.");
+ return 'This importer will import all your Pocket 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.';
}
/**
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
- ->existByUrlAndUserId($url, $this->user->getId());
+ ->findByUrlAndUserId($url, $this->user->getId());
if (false !== $existingEntry) {
++$this->skippedEntries;