PHP Class Wallabag\ImportBundle\Import\AbstractImport

Inheritance: implements Wallabag\ImportBundle\Import\ImportInterface
Afficher le fichier Open project: wallabag/wallabag

Protected Properties

Свойство Type Description
$contentProxy
$em
$importedEntries
$logger
$markAsRead
$producer
$queuedEntries
$skippedEntries
$user

Méthodes publiques

Méthode Description
__construct ( EntityManager $em, ContentProxy $contentProxy )
getMarkAsRead ( ) Get whether articles must be all marked as read.
getSummary ( )
parseEntry ( array $importedEntry ) : Entry Parse one entry.
setLogger ( Psr\Log\LoggerInterface $logger )
setMarkAsRead ( boolean $markAsRead ) Set whether articles must be all marked as read.
setProducer ( OldSound\RabbitMqBundle\RabbitMq\ProducerInterface $producer ) Set RabbitMQ/Redis Producer to send each entry to a queue.
setUser ( User $user ) Set current user.

Méthodes protégées

Méthode Description
fetchContent ( Entry $entry, string $url, array $content = [] ) : Entry Fetch content from the ContentProxy (using graby).
parseEntries ( $entries ) Parse and insert all given entries.
parseEntriesForProducer ( array $entries ) Parse entries and send them to the queue.
setEntryAsRead ( array $importedEntry ) : array Set current imported entry to archived / read.

Method Details

__construct() public méthode

public __construct ( EntityManager $em, ContentProxy $contentProxy )
$em Doctrine\ORM\EntityManager
$contentProxy Wallabag\CoreBundle\Helper\ContentProxy

fetchContent() protected méthode

If it fails return the given entry to be saved in all case (to avoid user to loose the content).
protected fetchContent ( Entry $entry, string $url, array $content = [] ) : Entry
$entry Wallabag\CoreBundle\Entity\Entry Entry to update
$url string Url to grab content for
$content array An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
Résultat Wallabag\CoreBundle\Entity\Entry

getMarkAsRead() public méthode

Get whether articles must be all marked as read.
public getMarkAsRead ( )

getSummary() public méthode

public getSummary ( )

parseEntries() protected méthode

Parse and insert all given entries.
protected parseEntries ( $entries )
$entries

parseEntriesForProducer() protected méthode

It should just be a simple loop on all item, no call to the database should be done to speedup queuing. Faster parse entries for Producer. We don't care to make check at this time. They'll be done by the consumer.
protected parseEntriesForProducer ( array $entries )
$entries array

parseEntry() abstract public méthode

Parse one entry.
abstract public parseEntry ( array $importedEntry ) : Entry
$importedEntry array
Résultat Wallabag\CoreBundle\Entity\Entry

setEntryAsRead() abstract protected méthode

Implementation is different accross all imports.
abstract protected setEntryAsRead ( array $importedEntry ) : array
$importedEntry array
Résultat array

setLogger() public méthode

public setLogger ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

setMarkAsRead() public méthode

Set whether articles must be all marked as read.
public setMarkAsRead ( boolean $markAsRead )
$markAsRead boolean

setProducer() public méthode

This method should be called when user has enabled RabbitMQ.
public setProducer ( OldSound\RabbitMqBundle\RabbitMq\ProducerInterface $producer )
$producer OldSound\RabbitMqBundle\RabbitMq\ProducerInterface

setUser() public méthode

Could the current *connected* user or one retrieve by the consumer.
public setUser ( User $user )
$user Wallabag\UserBundle\Entity\User

Property Details

$contentProxy protected_oe property

protected $contentProxy

$em protected_oe property

protected $em

$importedEntries protected_oe property

protected $importedEntries

$logger protected_oe property

protected $logger

$markAsRead protected_oe property

protected $markAsRead

$producer protected_oe property

protected $producer

$queuedEntries protected_oe property

protected $queuedEntries

$skippedEntries protected_oe property

protected $skippedEntries

$user protected_oe property

protected $user