API / Minn\Front / QueryMoves

QueryMoves final readonly class

Minn\Front\QueryMoves · public/minn/src/Minn/Front/QueryMoves.php · 119 lines

Where the root's archive query forms move under pretty permalinks, as the reference's canonical redirect answers them (suite permalinks): a feed (?feed=) first, then a date (?m=, ?year=), then an author by id, then a term when the query names exactly one taxonomy (?cat= or ?category_name=, ?tag=, ?taxonomy= with ?term=, a registered taxonomy's own var; ?post_format= counts as one but never moves itself), each to its pretty address with the other arguments along. Nothing moves while a search is asked for (?s=, even empty), past the first page, or to something the site does not have. The singles' forms are SingleQueries'.

Used by 1

Constants and properties

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\Terms $terms

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\Terms $terms, Minn\Front\Permalinks $permalinks)#
methodfor(Minn\Http\Request $request): ?Minn\Front\Resolution#

The move a root request's query string makes; null when it makes none.

Internals 6

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

privatedate(Minn\Http\Request $request): ?Minn\Front\Resolution#
privateauthor(Minn\Http\Request $request): ?Minn\Front\Resolution#
privatefeed(Minn\Http\Request $request): ?Minn\Front\Resolution#

?feed=: the feed at its pretty address: a comments feed under /comments/, one taxonomy's term's under the term, any other the site's, an author or date asked with it left behind. An unknown kind of feed moves nowhere.

privateterm(Minn\Http\Request $request): ?Minn\Front\Resolution#

The one taxonomy's term the query names, at its pretty address.

privateoneTerm(Minn\Http\Request $request): ?array#

The term of the one taxonomy the query names, with the arguments that name it; null when it names none, more than one, or a term the site does not have.

@return array{0: TermRecord, 1: list<string>}|null
privatelastSlug(string $path): string#