Subjects final readonly class
Minn\Rest\Subjects · public/minn/src/Minn/Rest/Subjects.php · 53 lines
Whether the record a route capture names exists, for the policy gate to ask before it judges the caller. A post kind reads its type from the {base} capture when the route has one, a term kind its taxonomy; the fixed kinds name their own. Status is not consulted: a trashed post exists, and what the caller may do with it is the policy's question.
Used by 2
Constants and properties
| private | POST_TYPES = array ( 'posts' => 'post', 'pages' => 'page', 'blocks' => 'wp_block', 'media' => 'attachment', 'navigation' => 'wp_navigation', 'menu-items' => 'nav_menu_item', ) | |
| private | TAXONOMIES = array ( 'categories' => 'category', 'tags' => 'post_tag', 'wp_pattern_category' => 'wp_pattern_category', ) | |
| private | readonly Minn\Db $db | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db)# | ||||
| method | exists(Minn\Http\Subject $subject, int $id, array $captures): bool# | Whether the record exists.
| |||
| method | postOfType(int $id, string $type): bool# | Whether a post of the type exists. | |||
| method | termOf(int $id, string $taxonomy): bool# | Whether a term of the taxonomy exists. |
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
Nothing matches.