API / Minn\Query / MimeWhere

MimeWhere final class

Minn\Query\MimeWhere · public/minn/src/Minn/Query/MimeWhere.php · 36 lines

wp_post_mime_type_where as the reference writes it (probe wp-query-sql): each mime type (a list or a comma-separated string) cleaned to a pattern, a bare group or a star widened with % into a LIKE, an exact type an equality, all OR'd; an empty type or a lone wildcard means no clause.

Constants and properties

privateWILDCARDS = array ( 0 => '', 1 => '%', 2 => '%/%', )

Public

staticsql(array|string $types, string $alias = ''): string#

The clause for some mime types, against a table's column when one is named. @param string|list<string> $types

$typesstring|list<string>

Internals 1

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

privatepattern(string $type): string#

A type cleaned to group/subgroup (an empty subgroup a star), or a bare group widened to group/*.