API / Minn\Runtime / QueriedObject

QueriedObject final readonly class

Minn\Runtime\QueriedObject · public/minn/src/Minn/Runtime/QueriedObject.php · 70 lines

Which object a query is "about", read from its flags and variables: a term (by id or slug), a post type, the posts page, the current post, or an author. The caller materialises the record; this only decides where to look.

Constants and properties

propreadonly string $kind

Promoted from the constructor.

propreadonly string $field

Promoted from the constructor.

propreadonly string|int $value

Promoted from the constructor.

propreadonly string $taxonomy

Promoted from the constructor.

Public

new__construct(string $kind, string $field = '', string|int $value = '', string $taxonomy = '')#
$kind'term'|'post_type'|'posts_page'|'post'|'author'|'none'
$fieldstring'id' or 'slug' (terms, authors); 'name' for a post type
staticlocate(array $vars, array $flags, Minn\Runtime\Registry $registry, callable $option): self#

The queried object the query vars and flags point at.

$varsarray<string, mixed>
$flagsarray<string, bool>the query's is_* flags
$optioncallable(string): mixeda filtered option read

Internals 1

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

privatetaxonomyTerm(array $vars, Minn\Runtime\Registry $registry): self#