LoadFeed
in package
Use case for loading/refreshing a feed from its RSS source.
Fetches the RSS feed, parses articles, inserts new ones, and updates the feed timestamp.
Tags
Table of Contents
Properties
- $articleRepository : ArticleRepositoryInterface
- $feedRepository : FeedRepositoryInterface
- $rssParser : RssParser
Methods
- __construct() : mixed
- Constructor.
- execute() : Feed|null, inserted: int, duplicates: int, error: string|null}
- Execute the use case.
- executeAutoUpdate() : array<int, array<string|int, mixed>>
- Load feeds that need auto-update.
- executeMultiple() : array<int, array<string|int, mixed>>
- Load multiple feeds.
- loadFeed() : Feed|null, inserted: int, duplicates: int, error: string|null}
- Load a feed entity.
Properties
$articleRepository
private
ArticleRepositoryInterface
$articleRepository
$feedRepository
private
FeedRepositoryInterface
$feedRepository
$rssParser
private
RssParser
$rssParser
Methods
__construct()
Constructor.
public
__construct(FeedRepositoryInterface $feedRepository, ArticleRepositoryInterface $articleRepository, RssParser $rssParser) : mixed
Parameters
- $feedRepository : FeedRepositoryInterface
-
Feed repository
- $articleRepository : ArticleRepositoryInterface
-
Article repository
- $rssParser : RssParser
-
RSS parser service
execute()
Execute the use case.
public
execute(int $feedId) : Feed|null, inserted: int, duplicates: int, error: string|null}
Parameters
- $feedId : int
-
Feed ID to load
Return values
Feed|null, inserted: int, duplicates: int, error: string|null}executeAutoUpdate()
Load feeds that need auto-update.
public
executeAutoUpdate() : array<int, array<string|int, mixed>>
Return values
array<int, array<string|int, mixed>> —Results keyed by feed ID
executeMultiple()
Load multiple feeds.
public
executeMultiple(array<string|int, int> $feedIds) : array<int, array<string|int, mixed>>
Parameters
- $feedIds : array<string|int, int>
-
Feed IDs to load
Return values
array<int, array<string|int, mixed>> —Results keyed by feed ID
loadFeed()
Load a feed entity.
public
loadFeed(Feed $feed) : Feed|null, inserted: int, duplicates: int, error: string|null}
Parameters
- $feed : Feed
-
Feed to load
Return values
Feed|null, inserted: int, duplicates: int, error: string|null} —Load result