API / Minn\Runtime / PostQueryParts

PostQueryParts final class

Minn\Runtime\PostQueryParts · public/minn/src/Minn/Runtime/PostQueryParts.php · 56 lines

The pieces of one WP_Query run as the reference builds them and hands them to filters. The seven clause pieces stay untyped: a filter may hand back anything, and the request is written from whatever it handed back.

Constants and properties

constPIECES = array ( 0 => 'where', 1 => 'groupby', 2 => 'join', 3 => 'orderby', 4 => 'distinct', 5 => 'fields', 6 => 'limits', )

The pieces posts_clauses and posts_clauses_request see, in their order.

propmixed $where
propmixed $groupby
propmixed $join
propmixed $orderby
propmixed $distinct
propmixed $fields
propmixed $limits
propmixed $search
propstring $whichauthor
propstring $whichmimetype
propbool $statusJoin

Whether an attachment's status follows its parent's (a taxonomy archive's attachments).

propint $page
propmixed $postType

The post type the query settles on: a name, a list, `any`, or empty.

prop?WP_Post_Type $typeObject
propstring $typeCap
proparray $statuses

The statuses asked for by name, which a single post's status check lets through. @var list<string>

propreadonly string $table

Promoted from the constructor.

Public

new__construct(string $table)#
methodpieces(): array#

The seven pieces by name. @return array<string, mixed>

@return array<string, mixed>
methodtake(array $clauses): void#

Takes back the pieces a clauses filter returned; one it dropped becomes empty. @param array<array-key, mixed> $clauses

$clausesarray<array-key, mixed>
methodrequest(string $foundRows, mixed $fields): string#

The SELECT as the reference writes it, line breaks and all, for the given field list.