API / Minn\Admin / StructureController

StructureController final readonly class

Minn\Admin\StructureController · public/minn/src/Minn/Admin/StructureController.php · 159 lines

The Structure view of minn-admin/v1: post types, taxonomies, and the terms switcher, each with its live counts, answered from the registries.

Used by 1

Constants and properties

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Rest\Types $types

Promoted from the constructor.

privatereadonly Minn\Rest\Taxonomies $taxonomies

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Rest\Types $types, Minn\Rest\Taxonomies $taxonomies, Minn\Rest\Caller $caller)#
methodtermTaxonomies(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/term-taxonomies (floor edit_posts)#

The taxonomies of each public type, for the Structure view.

methodpostTypes(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/post-types (floor edit_posts)#

The Structure view's post types: core and site-declared, with their live counts.

methodtaxonomies(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/taxonomies (floor edit_posts)#

Every taxonomy with its counts.

Internals 4

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

privatestamp(array $definition): string#

A definition's stamp, as Minn Admin makes it: a save sends it back as `base`, and a copy opened before someone else changed the definition is refused (409). Lists sorted, keys sorted, the escaped JSON's md5 cut to twelve characters.

$definitionarray<string, mixed>
privatepublicTypes(): array#
@return list<string>
privatetermCount(string $taxonomy): int#
privatepostCount(string $type): int#