Feed
in package
Feed entity representing an RSS/Atom feed subscription.
Feeds are sources of texts that users can subscribe to. The feed periodically fetches articles which can be imported as texts for reading.
Tags
Table of Contents
Properties
- $articleSectionTags : string
- $filterTags : string
- $id : int|null
- $languageId : int
- $name : string
- $options : FeedOptions
- $sourceUri : string
- $updateTimestamp : int
Methods
- articleSectionTags() : string
- changeLanguage() : void
- Change the language for this feed.
- create() : self
- Create a new feed.
- filterTags() : string
- fromDbRecord() : self
- Load from a database record.
- hasAutoUpdate() : bool
- Check if the feed has auto-update enabled.
- hasBeenUpdated() : bool
- Check if this feed has been updated at least once.
- id() : int|null
- isNew() : bool
- Check if this is a new (unsaved) feed.
- languageId() : int
- markUpdated() : void
- Update the last update timestamp.
- name() : string
- needsUpdate() : bool
- Check if the feed needs an update based on auto-update interval.
- options() : FeedOptions
- rename() : void
- Update the feed name.
- sourceUri() : string
- update() : void
- Update multiple feed properties at once.
- updateArticleSectionTags() : void
- Update the article section tags (XPath selector).
- updateFilterTags() : void
- Update the filter tags (XPath selectors for removal).
- updateOptions() : void
- Update the feed options.
- updateSourceUri() : void
- Update the feed source URI.
- updateTimestamp() : int
- __construct() : mixed
- Private constructor - use factory methods instead.
Properties
$articleSectionTags
private
string
$articleSectionTags
$filterTags
private
string
$filterTags
$id
private
int|null
$id
$languageId
private
int
$languageId
$name
private
string
$name
$options
private
FeedOptions
$options
$sourceUri
private
string
$sourceUri
$updateTimestamp
private
int
$updateTimestamp
Methods
articleSectionTags()
public
articleSectionTags() : string
Return values
stringchangeLanguage()
Change the language for this feed.
public
changeLanguage(int $languageId) : void
Parameters
- $languageId : int
-
New language ID
Tags
create()
Create a new feed.
public
static create(int $languageId, string $name, string $sourceUri[, string $articleSectionTags = '' ][, string $filterTags = '' ][, string $optionsString = '' ]) : self
Parameters
- $languageId : int
-
Language ID for this feed
- $name : string
-
Human-readable feed name
- $sourceUri : string
-
RSS/Atom feed URL
- $articleSectionTags : string = ''
-
XPath selector for article content
- $filterTags : string = ''
-
XPath selectors for elements to remove
- $optionsString : string = ''
-
Options string (key=value,key=value)
Tags
Return values
selffilterTags()
public
filterTags() : string
Return values
stringfromDbRecord()
Load from a database record.
public
static fromDbRecord(array<string, mixed> $record) : self
Parameters
- $record : array<string, mixed>
-
Database record
Return values
selfhasAutoUpdate()
Check if the feed has auto-update enabled.
public
hasAutoUpdate() : bool
Return values
boolhasBeenUpdated()
Check if this feed has been updated at least once.
public
hasBeenUpdated() : bool
Return values
boolid()
public
id() : int|null
Return values
int|nullisNew()
Check if this is a new (unsaved) feed.
public
isNew() : bool
Return values
boollanguageId()
public
languageId() : int
Return values
intmarkUpdated()
Update the last update timestamp.
public
markUpdated(int $timestamp) : void
Parameters
- $timestamp : int
-
Unix timestamp
name()
public
name() : string
Return values
stringneedsUpdate()
Check if the feed needs an update based on auto-update interval.
public
needsUpdate(int $currentTime) : bool
Parameters
- $currentTime : int
-
Current Unix timestamp
Return values
booloptions()
public
options() : FeedOptions
Return values
FeedOptionsrename()
Update the feed name.
public
rename(string $name) : void
Parameters
- $name : string
-
The new name
Tags
sourceUri()
public
sourceUri() : string
Return values
stringupdate()
Update multiple feed properties at once.
public
update(int $languageId, string $name, string $sourceUri, string $articleSectionTags, string $filterTags, FeedOptions $options) : void
Parameters
- $languageId : int
-
Language ID
- $name : string
-
Feed name
- $sourceUri : string
-
Source URI
- $articleSectionTags : string
-
XPath selectors for article content
- $filterTags : string
-
XPath selectors for elements to remove
- $options : FeedOptions
-
Feed options
Tags
updateArticleSectionTags()
Update the article section tags (XPath selector).
public
updateArticleSectionTags(string $tags) : void
Parameters
- $tags : string
-
XPath selector for article content
updateFilterTags()
Update the filter tags (XPath selectors for removal).
public
updateFilterTags(string $tags) : void
Parameters
- $tags : string
-
XPath selectors for elements to remove
updateOptions()
Update the feed options.
public
updateOptions(FeedOptions $options) : void
Parameters
- $options : FeedOptions
-
New options
updateSourceUri()
Update the feed source URI.
public
updateSourceUri(string $uri) : void
Parameters
- $uri : string
-
The new source URI
Tags
updateTimestamp()
public
updateTimestamp() : int
Return values
int__construct()
Private constructor - use factory methods instead.
private
__construct(int|null $id, int $languageId, string $name, string $sourceUri, string $articleSectionTags, string $filterTags, int $updateTimestamp, FeedOptions $options) : mixed
Parameters
- $id : int|null
- $languageId : int
- $name : string
- $sourceUri : string
- $articleSectionTags : string
- $filterTags : string
- $updateTimestamp : int
- $options : FeedOptions