KoniKodeKnowledge BaseMy AccountOpen website

KNOWLEDGE BASE

Documentation

DOCUMENTATION
CURRENT APPLICATIONClean Framework
DocumentationClean Framework

Clean Framework · DOCUMENTATION

Define a repository boundary

Define a repository boundary

Steps

Describe application concepts through an interface; keep SQL and provider-specific details in adapters. Start with a deterministic in-memory adapter when proving wiring.

// Members of ReadingListRepository; import the application ReadingItem type.
/** Return ordered domain records. */
public function all(): array;
/** Return an exact slug match, or null. */
public function findBySlug(string $slug): ?ReadingItem;

See repository interface and in-memory adapter. These do not persist across requests.

Verify

Reject duplicate keys, test absence, and replace the adapter in composition. Database adapters require bound values, application-owned schemas, and a disposable database test; see Database and migrations.

Editorial provenance

Source: resources/guides/repository.md. Source SHA-256: bdb69f153212e10d7914d7e02ae371e9a460b74399a624f235eae8810be205ef.

Knowledge-base application source; editorial checkpoint 2026-10-20. See candidate status and adoption boundary.

EXPLORE FURTHER

Drag a divider or use Left and Right Arrow keys to resize. Hold Shift for larger steps. Enter hides or restores the sidebar; Home and End select its minimum or maximum width. Double-click resets the width.