SubmissionsSource
Corex\Config\Data\SubmissionsSource · class · Config layer
The reference DataSource: stored form submissions (corex_submission posts). Shapes each record into id/date/form/summary; the WP_Query + meta access lives in the injected reader so this shaping is unit-tested headlessly (spec 030). A submission has three shapes here, each for one reader: the table’s row (a summary of the answers), the detail view’s record (each answer, labelled) and the export’s row (each answer under the field declared for it). They are shaped in this class and nowhere else.
Public API
Section titled “Public API”__construct(SubmissionsReader $reader)
Section titled “__construct(SubmissionsReader $reader)”key(): string
Section titled “key(): string”label(): string
Section titled “label(): string”category(): string
Section titled “category(): string”columns(): array
Section titled “columns(): array”rows(int $page, int $perPage): array
Section titled “rows(int $page, int $perPage): array”total(): int
Section titled “total(): int”query(DataQuery $query): array
Section titled “query(DataQuery $query): array”exportRows(DataQuery $query): array
Section titled “exportRows(DataQuery $query): array”exportRowsOf(array $ids): array
Section titled “exportRowsOf(array $ids): array”count(DataQuery $query): int
Section titled “count(DataQuery $query): int”record(int $id): ?array
Section titled “record(int $id): ?array”delete(int $id): bool
Section titled “delete(int $id): bool”Not from here. A submission is removed in the inbox, which checks who may, writes it into the submission’s history and records it (spec 105, FR-022); this used to trash it the WordPress way with none of that. The answer is the interface’s own “not permitted”.
capabilities(): DataSourceCapabilities
Section titled “capabilities(): DataSourceCapabilities”fields(): array
Section titled “fields(): array”schema(): array
Section titled “schema(): array”The real field schema: the fixed record id / submitted date / form columns plus the actual submitted payload keys discovered across recent submissions, each given a meaningful type (id/datetime/form/email/textarea/tel/text). No invented fields — when no submissions exist only the three fixed fields are returned.
trend(int $days): array
Section titled “trend(int $days): array”Real per-day submission counts for the last $days days, oldest first, every day present (missing days are a truthful zero — never fabricated).