PHP Class Wallabag\CoreBundle\Helper\ContentProxy

Afficher le fichier Open project: wallabag/wallabag Class Usage Examples

Protected Properties

Свойство Type Description
$graby
$logger
$mimeGuesser
$tagRepository
$tagger

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
validateContent ( array $content ) : boolean Validate that the given content as enough value to be used instead of fetch the content from the url.

Method Details

__construct() public méthode

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() public méthode

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() public méthode

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
Résultat Wallabag\CoreBundle\Entity\Entry

Property Details

$graby protected_oe property

protected $graby

$logger protected_oe property

protected $logger

$mimeGuesser protected_oe property

protected $mimeGuesser

$tagRepository protected_oe property

protected $tagRepository

$tagger protected_oe property

protected $tagger