FeedOptions
in package
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
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
$options
private
array<string, string>
$options
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|nullautoUpdate()
Get auto-update interval string (e.g., "2h", "1d", "1w").
public
autoUpdate() : string|null
Return values
string|nullautoUpdateSeconds()
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|nulleditText()
Whether to show edit form before importing articles.
public
editText() : bool
Return values
boolempty()
Create empty options.
public
static empty() : self
Return values
selffromArray()
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
selffromString()
Create from options string (comma-separated key=value pairs).
public
static fromString(string $optionsString) : self
Parameters
- $optionsString : string
-
Options string
Return values
selfget()
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
boolmaxLinks()
Get maximum number of article links to keep.
public
maxLinks() : int|null
Return values
int|nullmaxTexts()
Get maximum number of texts before auto-archival.
public
maxTexts() : int|null
Return values
int|nulltag()
Get tag name to apply to imported texts.
public
tag() : string|null
Return values
string|nulltoString()
Serialize to string format for database storage.
public
toString() : string
Return values
stringwithArticleSource()
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
selfwithAutoUpdate()
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
selfwithCharset()
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
selfwithEditText()
Return a new instance with edit_text option set.
public
withEditText(bool $editText) : self
Parameters
- $editText : bool
-
Whether to show edit form
Return values
selfwithMaxLinks()
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
selfwithMaxTexts()
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
selfwithTag()
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>