BeechCMS / @beechcms/core / SeedRegistry
Class: SeedRegistry
Extended by
Implements
Constructors
Constructor
new SeedRegistry(
seeds):SeedRegistry
Parameters
seeds
Seed[]
Returns
SeedRegistry
Methods
all()
all():
Seed[]
Returns all seeds as a flat array, preserving insertion order. Decouples callers from the internal storage shape so the registry implementation can change without touching every route handler.
Returns
Seed[]
Implementation of
draftEnabled()
draftEnabled():
Seed[]
Returns seeds that have the draft workflow enabled. Eliminates the seeds.filter(s => s.allowDrafts) pattern.
Returns
Seed[]
Implementation of
get()
get(
slug):Seed|null
Returns the seed with the given slug, or null if not found. Provides a single lookup point that can be overridden in tests without rebuilding the full registry object.
Parameters
slug
string
Returns
Seed | null
Implementation of
publicReadable()
publicReadable():
Seed[]
Returns seeds that have allowPublicRead enabled. Eliminates the seeds.filter(s => s.allowPublicRead) pattern.
Returns
Seed[]
Implementation of
visibleInDashboard()
visibleInDashboard():
Seed[]
Returns seeds that are visible in the dashboard sidebar. A seed is visible when dashboard.hidden is not explicitly true. Eliminates the seeds.filter(s => !s.dashboard?.hidden) pattern that would otherwise be duplicated across route handlers.
Returns
Seed[]