PHP Class Wallabag\CoreBundle\Helper\ContentProxy

Show file Open project: wallabag/wallabag Class Usage Examples

Protected Properties

Property Type Description
$graby
$logger
$mimeGuesser
$tagRepository
$tagger

Public Methods

Method 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

Method 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 method

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 method

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 method

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
return Wallabag\CoreBundle\Entity\Entry

Property Details

$graby protected property

protected $graby

$logger protected property

protected $logger

$mimeGuesser protected property

protected $mimeGuesser

$tagRepository protected property

protected $tagRepository

$tagger protected property

protected $tagger