ImportArticles
in package
Use case for importing articles as texts.
Converts feed articles to LWT texts by:
- Extracting content from article URLs
- Creating text entries with parsing
- Applying tags and archiving old texts
Tags
Table of Contents
Properties
- $articleExtractor : ArticleExtractor
- $articleRepository : ArticleRepositoryInterface
- $feedRepository : FeedRepositoryInterface
- $textCreation : TextCreationInterface
Methods
- __construct() : mixed
- Constructor.
-
execute()
: array{imported: int, failed: int, archived: int, errors: array
} - Execute the use case.
- importFeedArticles() : array{imported: int, failed: int, archived: int, errors: string[]}
- Import articles for a specific feed.
Properties
$articleExtractor
private
ArticleExtractor
$articleExtractor
$articleRepository
private
ArticleRepositoryInterface
$articleRepository
$feedRepository
private
FeedRepositoryInterface
$feedRepository
$textCreation
private
TextCreationInterface
$textCreation
Methods
__construct()
Constructor.
public
__construct(ArticleRepositoryInterface $articleRepository, FeedRepositoryInterface $feedRepository, TextCreationInterface $textCreation, ArticleExtractor $articleExtractor) : mixed
Parameters
- $articleRepository : ArticleRepositoryInterface
-
Article repository
- $feedRepository : FeedRepositoryInterface
-
Feed repository
- $textCreation : TextCreationInterface
-
Text creation adapter
- $articleExtractor : ArticleExtractor
-
Article extractor service
execute()
Execute the use case.
public
execute(array<string|int, int> $articleIds) : array{imported: int, failed: int, archived: int, errors: array}
Parameters
- $articleIds : array<string|int, int>
-
Article IDs to import
Return values
array{imported: int, failed: int, archived: int, errors: arrayimportFeedArticles()
Import articles for a specific feed.
private
importFeedArticles(Feed $feed, array<string|int, Article> $articles) : array{imported: int, failed: int, archived: int, errors: string[]}
Parameters
Return values
array{imported: int, failed: int, archived: int, errors: string[]} —Import result