CommentOrder final class
Minn\Query\CommentOrder · public/minn/src/Minn/Query/CommentOrder.php · 100 lines
WP_Comment_Query's ORDER BY and LIMIT as the reference writes them (probe wp-comment-query-sql): no orderby means comment_date_gmt in the order asked; a list, a string of keys or a map of keys to directions each become a column, a meta value or the FIELD() list comment__in gives; a key it does not know is dropped (none left means comment_date_gmt), and unless comment_ID or comment__in is among them a comment_ID tiebreak follows, in the first date clause's direction or DESC.
Constants and properties
| private | COLUMNS = array ( 0 => 'comment_agent', 1 => 'comment_approved', 2 => 'comment_author', 3 => 'comment_author_email', 4 => 'comment_author_IP', 5 => 'comment_author_url', 6 => 'comment_content', 7 => 'comment_date', 8 => 'comment_date_gmt', 9 => 'comment_ID', 10 => 'comment_karma', 11 => 'comment_parent', 12 => 'comment_post_ID', 13 => 'comment_type', 14 => 'user_id', ) | |
| private | IDS = 'comment__in' |
Public
| static | direction(mixed $order): string# | ASC when asked for, DESC for anything else. | ||||||
| static | build(array $qv, string $table, string $metaTable, array $metaClauses): string# | The ORDER BY body for the query's orderby and order ('' for none).
| ||||||
| static | clause(string $by, array $qv, string $table, string $metaTable, array $metaClauses): string# | One orderby key as SQL, or '' when the reference does not take it: a column, the meta value (as a number when asked), a named meta clause's cast value, or the FIELD() list keeping comment__in's order.
| ||||||
| static | limits(array $qv): string# | LIMIT from number, and the offset (or the page when no offset is given). @param array<string, mixed> $qv
|
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
Nothing matches.