Document final readonly class
Minn\Feed\Document · public/minn/src/Minn/Feed/Document.php · 114 lines
A parsed feed: the tree and the format it was recognized as (the reference's type bits: RSS 0.90 1, the 0.9x versions 2 to 32, RSS 1.0 64, RSS 2.0 128, Atom 0.3 256, Atom 1.0 512), with the lookups the feed object is built on: the root's children, the channel's, the image's, and the items of every format the document carries.
Constants and properties
| const | NONE = 0 | |
| const | RSS_090 = 1 | |
| const | RSS_10 = 64 | |
| const | RSS_20 = 128 | |
| const | ATOM_03 = 256 | |
| const | ATOM_10 = 512 | |
| const | RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' | |
| private | RSS_VERSIONS = array ( '0.91' => 4, '0.92' => 8, '0.93' => 16, '0.94' => 32, ) | |
| prop | readonly array $tree | Promoted from the constructor. |
| prop | readonly int $type | Promoted from the constructor. |
Public
| new | __construct(array $tree, int $type)# |
| |||
| static | parse(string $body, string $contentType = ''): self# | A document read from bytes; the type is NONE when it parsed but is no feed. | |||
| static | fromTree(array $tree): self# | A document over a tree already parsed (a cached feed), its type read from the root.
| |||
| method | root(): ?array# | The root element (rss, rdf:RDF or feed), or null. | |||
| method | channel(): ?array# | The channel element: an RSS channel, or the Atom feed itself. | |||
| method | image(): ?array# | The image element: inside an RSS 2.0 channel, beside an RSS 1.0 one. | |||
| method | feedTags(string $ns, string $tag): ?array# | Children of the root element by namespace and name, or null. | |||
| method | channelTags(string $ns, string $tag): ?array# | Children of the channel by namespace and name, or null. | |||
| method | imageTags(string $ns, string $tag): ?array# | Children of the image by namespace and name, or null. | |||
| method | items(): array# | Every item node, in document order: Atom 1.0 and 0.3 entries, RSS 1.0 and 0.90 items beside the channel, RSS 2.0 items inside it. @return list<array<string, mixed>> |
Nothing matches.