PHP Класс Wallabag\ImportBundle\Import\AbstractImport

Наследование: implements Wallabag\ImportBundle\Import\ImportInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$contentProxy
$em
$importedEntries
$logger
$markAsRead
$producer
$queuedEntries
$skippedEntries
$user

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

fetchContent() защищенный Метод

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
Результат Wallabag\CoreBundle\Entity\Entry

getMarkAsRead() публичный Метод

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

getSummary() публичный Метод

public getSummary ( )

parseEntries() защищенный Метод

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

parseEntriesForProducer() защищенный Метод

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() абстрактный публичный Метод

Parse one entry.
abstract public parseEntry ( array $importedEntry ) : Entry
$importedEntry array
Результат Wallabag\CoreBundle\Entity\Entry

setEntryAsRead() абстрактный защищенный Метод

Implementation is different accross all imports.
abstract protected setEntryAsRead ( array $importedEntry ) : array
$importedEntry array
Результат array

setLogger() публичный Метод

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

setMarkAsRead() публичный Метод

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

setProducer() публичный Метод

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

setUser() публичный Метод

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

Описание свойств

$contentProxy защищенное свойство

protected $contentProxy

$em защищенное свойство

protected $em

$importedEntries защищенное свойство

protected $importedEntries

$logger защищенное свойство

protected $logger

$markAsRead защищенное свойство

protected $markAsRead

$producer защищенное свойство

protected $producer

$queuedEntries защищенное свойство

protected $queuedEntries

$skippedEntries защищенное свойство

protected $skippedEntries

$user защищенное свойство

protected $user