SectionCatalogue
Every section the booted plugins declared, validated and ordered. Built per request from the plugin instances the kernel holds, so a plugin that boots after the panel still shows up. Duplicate ids fail loudly ({@see SectionConflictException}); the panel never picks one silently.
SectionCatalogue::discover()
public static function discover(iterable $plugins): selfCollects the sections of every plugin that implements {@see AdminSectionProvider}.
Parameters
| Name | Type | Description |
|---|---|---|
| $plugins | iterable<object> | the booted plugin instances, in any order |
SectionCatalogue::sections()
public function sections(): arrayThe sections in sidebar order.
SectionCatalogue::roots()
public function roots(): arrayThe sections the MAIN NAVIGATION shows: the ones that belong under nobody. 🚨 THIS IS A SECOND READER AND NOT A NARROWING OF {@see sections()}, deliberately. Three of that method's five callers want every section: the panel's 404 lists the ids present, and a child missing from the error whose whole job is naming what exists would be invisible exactly when somebody is looking for it; the component book must cover a child's component like any other; and the TUI needs state for every section it can open. Narrowing the old method would have broken all three in silence (greenhouse decisions/0268). A section whose parent nobody declared comes back HERE, as a root. The alternative hides a working section because a different plugin is absent, which turns uninstalling one thing into losing another.
SectionCatalogue::children()
public function children(string $id): arrayThe sections declared under that one, in the same order the sidebar uses. Empty for a section nobody named as a parent — which is what the shell reads to decide whether to paint a gear at all.
Parameters
| Name | Type | Description |
|---|---|---|
| $id | string |
SectionCatalogue::find()
public function find(string $id): ?Milpa\Admin\Section\AdminSectionThe section with that id, or null when no plugin declared it.
Parameters
| Name | Type | Description |
|---|---|---|
| $id | string |
SectionCatalogue::first()
public function first(): ?Milpa\Admin\Section\AdminSectionThe section the panel opens on — the first ROOT in sidebar order — or null when there is none. A child can never be the front page: it is reached through its parent's gear, and a panel that opened on somebody's settings screen would answer «what is this house» with «here are its knobs» (greenhouse decisions/0264, decisions/0268).
SectionCatalogue::declaredBy()
public function declaredBy(string $id): ?stringThe plugin class that declared a section, or null when no plugin declared it.
Parameters
| Name | Type | Description |
|---|---|---|
| $id | string |
SectionCatalogue::isEmpty()
public function isEmpty(): boolTrue when no plugin declared any section.