Documentation

FeedOptions
in package

FinalYes

Value object representing feed options.

Options are stored as comma-separated key=value pairs in the database. This class provides type-safe access to common options.

Supported options:

  • edit_text: Whether to show edit form before importing (1 or 0)
  • autoupdate: Auto-update interval (e.g., "2h", "1d", "1w")
  • max_links: Maximum number of article links to keep
  • max_texts: Maximum number of texts before auto-archival
  • charset: Character encoding for article fetching
  • tag: Tag name to apply to imported texts
  • article_source: Source for article text (description, encoded, content, webpage)
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

$options  : array<string, string>

Methods

all()  : array<string, string>
Get all options as array.
articleSource()  : string|null
Get article text source (description, encoded, content, webpage).
autoUpdate()  : string|null
Get auto-update interval string (e.g., "2h", "1d", "1w").
autoUpdateSeconds()  : int|null
Get auto-update interval in seconds.
charset()  : string|null
Get character encoding override for article fetching.
editText()  : bool
Whether to show edit form before importing articles.
empty()  : self
Create empty options.
fromArray()  : self
Create from array of options.
fromString()  : self
Create from options string (comma-separated key=value pairs).
get()  : string|null
Get a specific option value.
has()  : bool
Check if an option is set.
maxLinks()  : int|null
Get maximum number of article links to keep.
maxTexts()  : int|null
Get maximum number of texts before auto-archival.
tag()  : string|null
Get tag name to apply to imported texts.
toString()  : string
Serialize to string format for database storage.
withArticleSource()  : self
Return a new instance with article_source option set.
withAutoUpdate()  : self
Return a new instance with autoupdate option set.
withCharset()  : self
Return a new instance with charset option set.
withEditText()  : self
Return a new instance with edit_text option set.
withMaxLinks()  : self
Return a new instance with max_links option set.
withMaxTexts()  : self
Return a new instance with max_texts option set.
withTag()  : self
Return a new instance with tag option set.
__construct()  : mixed

Properties

Methods

all()

Get all options as array.

public all() : array<string, string>
Return values
array<string, string>

articleSource()

Get article text source (description, encoded, content, webpage).

public articleSource() : string|null
Return values
string|null

autoUpdate()

Get auto-update interval string (e.g., "2h", "1d", "1w").

public autoUpdate() : string|null
Return values
string|null

autoUpdateSeconds()

Get auto-update interval in seconds.

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

Seconds or null if not set/invalid

charset()

Get character encoding override for article fetching.

public charset() : string|null
Return values
string|null

editText()

Whether to show edit form before importing articles.

public editText() : bool
Return values
bool

empty()

Create empty options.

public static empty() : self
Return values
self

fromArray()

Create from array of options.

public static fromArray(array<string, string|int|bool|null> $options) : self
Parameters
$options : array<string, string|int|bool|null>

Options array

Return values
self

fromString()

Create from options string (comma-separated key=value pairs).

public static fromString(string $optionsString) : self
Parameters
$optionsString : string

Options string

Return values
self

get()

Get a specific option value.

public get(string $key) : string|null
Parameters
$key : string

Option key

Return values
string|null

Option value or null if not set

has()

Check if an option is set.

public has(string $key) : bool
Parameters
$key : string

Option key

Return values
bool

Get maximum number of article links to keep.

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

maxTexts()

Get maximum number of texts before auto-archival.

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

tag()

Get tag name to apply to imported texts.

public tag() : string|null
Return values
string|null

toString()

Serialize to string format for database storage.

public toString() : string
Return values
string

withArticleSource()

Return a new instance with article_source option set.

public withArticleSource(string|null $source) : self
Parameters
$source : string|null

Source type or null to remove

Return values
self

withAutoUpdate()

Return a new instance with autoupdate option set.

public withAutoUpdate(string|null $interval) : self
Parameters
$interval : string|null

Interval string (e.g., "2h") or null to remove

Return values
self

withCharset()

Return a new instance with charset option set.

public withCharset(string|null $charset) : self
Parameters
$charset : string|null

Charset or null to remove

Return values
self

withEditText()

Return a new instance with edit_text option set.

public withEditText(bool $editText) : self
Parameters
$editText : bool

Whether to show edit form

Return values
self

Return a new instance with max_links option set.

public withMaxLinks(int|null $maxLinks) : self
Parameters
$maxLinks : int|null

Maximum links or null to remove

Return values
self

withMaxTexts()

Return a new instance with max_texts option set.

public withMaxTexts(int|null $maxTexts) : self
Parameters
$maxTexts : int|null

Maximum texts or null to remove

Return values
self

withTag()

Return a new instance with tag option set.

public withTag(string|null $tag) : self
Parameters
$tag : string|null

Tag name or null to remove

Return values
self

__construct()

private __construct(array<string, string> $options) : mixed
Parameters
$options : array<string, string>

        
On this page

Search results