FeedLoadApiHandler
in package
Sub-handler for feed loading API operations.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- detectFeed() : array<string|int, mixed>|null
- Detect feed format and parse.
- formatLoadFeed() : array{success?: true, message?: string, imported?: int, duplicates?: int, error?: string}
- Format response for loading a feed.
- getFeedLoadConfig() : array<string|int, mixed>
- Get feed load configuration for frontend.
- getFeedResult() : string
- Update the feeds database and return a result message.
- getFeeds() : array<string|int, mixed>
- Get list of feeds (simple version).
- getFeedsList() : array{0: int, 1: int}
- Get the list of feeds and insert them into the database.
- getFeedsNeedingAutoUpdate() : array<string|int, mixed>
- Get feeds needing auto-update.
- loadFeed() : array{success?: true, message?: string, imported?: int, duplicates?: int, error?: string}
- Load a feed and return result.
- parseFeed() : array<string|int, mixed>|null
- Parse an RSS feed for preview.
Properties
$feedFacade
private
FeedFacade
$feedFacade
Methods
__construct()
public
__construct(FeedFacade $feedFacade) : mixed
Parameters
- $feedFacade : FeedFacade
detectFeed()
Detect feed format and parse.
public
detectFeed(string $sourceUri) : array<string|int, mixed>|null
Parameters
- $sourceUri : string
-
Feed URL
Return values
array<string|int, mixed>|null —Feed data with metadata or null on error
formatLoadFeed()
Format response for loading a feed.
public
formatLoadFeed(string $name, int $feedId, string $sourceUri, string $options) : array{success?: true, message?: string, imported?: int, duplicates?: int, error?: string}
Parameters
- $name : string
-
Feed name
- $feedId : int
-
Feed ID
- $sourceUri : string
-
Feed source URI
- $options : string
-
Feed options
Return values
array{success?: true, message?: string, imported?: int, duplicates?: int, error?: string}getFeedLoadConfig()
Get feed load configuration for frontend.
public
getFeedLoadConfig(int $feedId[, bool $checkAutoupdate = false ]) : array<string|int, mixed>
Parameters
- $feedId : int
-
Feed ID
- $checkAutoupdate : bool = false
-
Check auto-update feeds
Return values
array<string|int, mixed> —Configuration
getFeedResult()
Update the feeds database and return a result message.
public
getFeedResult(int $importedFeed, int $nif, string $nfname, int $nfid, string $nfoptions) : string
Parameters
- $importedFeed : int
-
Number of imported feeds
- $nif : int
-
Number of duplicated feeds
- $nfname : string
-
News feed name
- $nfid : int
-
News feed ID
- $nfoptions : string
-
News feed options
Return values
string —Result message
getFeeds()
Get list of feeds (simple version).
public
getFeeds([int|null $languageId = null ]) : array<string|int, mixed>
Parameters
- $languageId : int|null = null
-
Language ID filter (null for all)
Return values
array<string|int, mixed> —Array of feeds
getFeedsList()
Get the list of feeds and insert them into the database.
public
getFeedsList(array<string|int, array<string, string>> $feed, int $nfid) : array{0: int, 1: int}
Parameters
- $feed : array<string|int, array<string, string>>
-
A feed with articles
- $nfid : int
-
News feed ID
Return values
array{0: int, 1: int} —Number of imported feeds and number of duplicated feeds.
getFeedsNeedingAutoUpdate()
Get feeds needing auto-update.
public
getFeedsNeedingAutoUpdate() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of feeds
loadFeed()
Load a feed and return result.
public
loadFeed(string $nfname, int $nfid, string $nfsourceuri, string $nfoptions) : array{success?: true, message?: string, imported?: int, duplicates?: int, error?: string}
Parameters
- $nfname : string
-
Newsfeed name
- $nfid : int
-
News feed ID
- $nfsourceuri : string
-
News feed source
- $nfoptions : string
-
News feed options
Return values
array{success?: true, message?: string, imported?: int, duplicates?: int, error?: string}parseFeed()
Parse an RSS feed for preview.
public
parseFeed(string $sourceUri[, string $articleSection = '' ]) : array<string|int, mixed>|null
Parameters
- $sourceUri : string
-
Feed URL
- $articleSection : string = ''
-
Article section tag
Return values
array<string|int, mixed>|null —Feed data or null on error