Data & ORM
Data in Semitexa PHP: a type-safe query builder, relations without N+1, filtering, pagination, repositories and schema sync instead of migrations.
-
Domain-Level Models
Semitexa separates persistence resources from business models. Resources map tables; domain models carry behavior and invariants.
-
Repository Workflow
The canonical Semitexa path: handlers depend on repository contracts, repositories return domain models, and persistence resources stay behind the boundary.
-
Schema Sync, Not Migration Churn
Semitexa creates SQL only when the real schema changed, blocks destructive drops by default, and logs the exact DDL plan as SQL and JSON.
-
Query Builder
Compose type-safe queries with a fluent API. No raw SQL, no magic strings.
-
Filtering
Mark a property #[Filterable] and the ORM handles the rest. No manual WHERE clauses.
-
Pagination
Offset and cursor pagination out of the box. Switch modes with a single query parameter.
-
Relations
Declare parent and child links on the resource itself, then read typed relations from the handler.
-
Shared Table Extension
Two modules can extend one table independently, and the ORM merges the schema without forcing either side to edit the other.
-
N+1 Without Magic
Semitexa avoids N+1 with resource slices that load the exact columns and relations each screen needs, instead of hiding queries behind implicit loading.
-
ORM Working Guide
Declaring a resource, querying it, relations and write policies, optimistic locking, transactions, wiring a store, and the gotchas.
-
Cache
Keep expensive results with CacheManagerInterface — per-worker memory or shared Redis, TTLs, single-flight remember(), namespaces, tags, and tenant isolation.
-
File Storage and Uploads
Keep files with StorageObjectStoreInterface on local disk or an S3-compatible store, receive multipart uploads as UploadedFile, and size the server for them.
-
Search
Declare a search index over a table, run free-text and filtered searches through SearchManagerInterface, and know what SQL LIKE matching, page-local ranking, tenant scoping and the LLM planner really do.