PHP Класс Wallabag\CoreBundle\Helper\ContentProxy

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$graby
$logger
$mimeGuesser
$tagRepository
$tagger

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

Метод Описание
__construct ( Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, Psr\Log\LoggerInterface $logger )
assignTagsToEntry ( Entry $entry, array | string $tags, array $entitiesReady = [] ) Assign some tags to an entry.
updateEntry ( Entry $entry, string $url, array $content = [] ) : Entry Fetch content using graby and hydrate given entry with results information.

Приватные методы

Метод Описание
validateContent ( array $content ) : boolean Validate that the given content as enough value to be used instead of fetch the content from the url.

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

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

public __construct ( Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, Psr\Log\LoggerInterface $logger )
$graby Graby\Graby
$tagger RuleBasedTagger
$tagRepository Wallabag\CoreBundle\Repository\TagRepository
$logger Psr\Log\LoggerInterface

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

Assign some tags to an entry.
public assignTagsToEntry ( Entry $entry, array | string $tags, array $entitiesReady = [] )
$entry Wallabag\CoreBundle\Entity\Entry
$tags array | string An array of tag or a string coma separated of tag
$entitiesReady array Entities from the EntityManager which are persisted but not yet flushed It is mostly to fix duplicate tag on import @see http://stackoverflow.com/a/7879164/569101

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

In case we couldn't find content, we'll try to use Open Graph data. We can also force the content, in case of an import from the v1 for example, so the function won't fetch the content from the website but rather use information given with the $content parameter.
public updateEntry ( 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

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

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

protected $graby

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

protected $logger

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

protected $mimeGuesser

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

protected $tagRepository

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

protected $tagger