API / Minn\Front / ArchiveAddresses

ArchiveAddresses final readonly class

Minn\Front\ArchiveAddresses · public/minn/src/Minn/Front/ArchiveAddresses.php · 97 lines

The archives an address may stand for, as the reference answers them: the front, a search, a term's (a category's, a tag's, a plugin taxonomy's), an author's and a date's. Each is the archive when what it names exists (a term by its path's last slug, a valid date; an author's for any name); whether its page has posts is the main query's to say, and an empty page past the first, or an empty date, is the 404 it decides (Theme\FrontLifecycle::handle404).

Constants and properties

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\Posts $posts

Promoted from the constructor.

privatereadonly Minn\Content\Terms $terms

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Closure $readable

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\Posts $posts, Minn\Content\Terms $terms, Minn\Front\Permalinks $permalinks, Closure $readable)#
$readableClosure(PostRecord): boolwhether the reader may read a post
methodsearch(string $term, int $paged): Minn\Front\Resolution#

A search's results page.

methodhome(int $paged): Minn\Front\Resolution#

The front: the static front page when there is one, else the posts listing.

methodtaxonomy(string $taxonomy, array $slugs, int $paged): Minn\Front\Resolution#

A plugin taxonomy's term archive by its path; a 404 when no term is at that path.

$slugslist<string>
methodterm(string $taxonomy, array $slugs, int $paged): Minn\Front\Resolution#

A category's or tag's archive by its path; a 404 when no term is at that path. @param list<string> $slugs

$slugslist<string>
methodauthor(string $name, int $paged): Minn\Front\Resolution#

An author's archive by nicename: the archive for any name, the author's when one has it.

methoddate(array $segments, int $paged): Minn\Front\Resolution#

A date archive by year, month and day; a 404 when the date is not one. @param list<string> $segments

$segmentslist<string>
staticisDate(int $year, ?int $month, ?int $day): bool#

Whether a year, month and day (the last two optional, a day only with its month) name a date.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateat(string $taxonomy, array $slugs): ?Minn\Content\TermRecord#

The term a slug path names: its last slug's, whatever the segments before it say (the reference serves /category/any/child/ as the child's archive, unmoved).

$slugslist<string>