CommentQueryRunner final class
Minn\Runtime\CommentQueryRunner · public/minn/src/Minn/Runtime/CommentQueryRunner.php · 131 lines
WP_Comment_Query as the reference runs it (probe wp-comment-query-sql): the variables filled and handed to pre_get_comments, the meta query's SQL, comments_pre_query (which may answer), the clauses (the date query among them) handed to comments_clauses, the request, found_comments_query when a limited query counts what it found, then the ids, the count, or the comments through the_comments, threaded or flattened when asked. Results are not cached between queries (the reference keeps them in the object cache by last_changed).
Constants and properties
| private | readonly object $wpdb | Promoted from the constructor. |
Public
| new | __construct(object $wpdb)# | ||||
| method | run(WP_Comment_Query $query): mixed# | Runs the query, as WP_Comment_Query::get_comments() does: a count, ids, or comments. | |||
| method | ids(WP_Comment_Query $query, array $meta): array|int# | The comment IDs for the query's vars (get_comment_ids), or the count when it counts; the request is written, and the found rows read when the request counts them and found some.
@return list<int>|int |
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | request(WP_Comment_Query $query, array $meta): array# | The clauses through comments_clauses, kept on the query and written as its request, and whether the request counts the rows it found.
@return array{0: string, 1: bool} | ||||||
| private | comments(array $ids, array $qv): array# | The comments for the ids in their order, each through get_comment(), their posts loaded first when asked.
@return list<\WP_Comment> |
Nothing matches.