UserQueryRoles final class
Minn\Runtime\UserQueryRoles · public/minn/src/Minn/Runtime/UserQueryRoles.php · 91 lines
A user query's roles and capabilities as the meta clauses the reference writes for them (probe wp-user-query-sql): a capability matches its own name or any role granting it, capability__in and __not_in widen the role lists, and each role is a LIKE on the site's capabilities meta (NOT LIKE to leave it out).
Constants and properties
| private | readonly string $capabilitiesKey | Promoted from the constructor. |
Public
| new | __construct(string $capabilitiesKey)# | ||||||||||
| method | clauses(array $qv, array $queries, array $roles): array# | The meta query's clauses once the roles and capabilities join them.
@return array<array-key, mixed> |
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | lists(array $qv, array $roles): array# | The roles asked for, the role__in and role__not_in lists (widened by the roles granting capability__in and __not_in, then the capabilities themselves), and the roles granting each capability asked for.
@return array{0: array{roles: list<string>, capabilities: list<string>}, 1: list<string>, 2: list<string>, 3: array<string, list<string>>} | ||||||
| private | firstOf(array $wanted, array $granted): ?string# | The first of the wanted capabilities a role grants, in the order asked. @param list<string> $wanted @param list<string> $granted
| ||||||
| private | like(string $role, string $compare = 'LIKE'): array# | @return array<string, string> |
Nothing matches.