Documentation

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
category

Lwt

author

HugoFara hugo.farajallah@protonmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/docs/php/
since
3.0.0

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

$sourceUri

private string $sourceUri

$updateTimestamp

private int $updateTimestamp

Methods

articleSectionTags()

public articleSectionTags() : string
Return values
string

changeLanguage()

Change the language for this feed.

public changeLanguage(int $languageId) : void
Parameters
$languageId : int

New language ID

Tags
throws
InvalidArgumentException

If language ID is invalid

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
throws
InvalidArgumentException

If name or sourceUri is empty

Return values
self

filterTags()

public filterTags() : string
Return values
string

fromDbRecord()

Load from a database record.

public static fromDbRecord(array<string, mixed> $record) : self
Parameters
$record : array<string, mixed>

Database record

Return values
self

hasAutoUpdate()

Check if the feed has auto-update enabled.

public hasAutoUpdate() : bool
Return values
bool

hasBeenUpdated()

Check if this feed has been updated at least once.

public hasBeenUpdated() : bool
Return values
bool

id()

public id() : int|null
Return values
int|null

isNew()

Check if this is a new (unsaved) feed.

public isNew() : bool
Return values
bool

languageId()

public languageId() : int
Return values
int

markUpdated()

Update the last update timestamp.

public markUpdated(int $timestamp) : void
Parameters
$timestamp : int

Unix timestamp

name()

public name() : string
Return values
string

needsUpdate()

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
bool

rename()

Update the feed name.

public rename(string $name) : void
Parameters
$name : string

The new name

Tags
throws
InvalidArgumentException

If name is empty or too long

sourceUri()

public sourceUri() : string
Return values
string

update()

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
throws
InvalidArgumentException

If any value is invalid

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
throws
InvalidArgumentException

If URI is empty or too long

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

        
On this page

Search results