Conversation
Getter classes are registered with the Factory and become methods you can run on the Factory. The existing Getters trait for ActiveRecord models scans Factory for Getters and attached them to itself as well providing $className::$methodName() as static calls while using a Factory backend.
…ses for each Endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complexity Refactor
This PR continues the cleanup and simplification work across the model/database layer and the controller/request handling layer. No existing external APIs are broken — all public-facing interfaces remain intact.
What's New for Developers
Model: Type Hints & Null Hints Now Drive Schema Generation
You can now use PHP native type hints and nullable type hints (
?string,?int, etc.) on your model properties to declare nullability, instead of relying on thenotnullcolumn attribute. The schema generator reads these directly from your class definitions. This brings model declarations in line with modern PHP and reduces the need for extra attribute boilerplate.Getters Converted to First-Class Classes
Getter behavior (e.g.
getBy*,getAllBy*) has been moved into dedicated getter classes underFactory/Getters.Factoryis now the single source of truth for getter registration — each getter is registered once and dispatched through a small map.For model code using the
Getterstrait: nothing changes. Static calls likeMyModel::getByField(...)continue to work exactly as before. Internally they now bubble throughFactory, but the call signature is identical.For developers extending or adding getters: you now only need to define a getter class in one place rather than maintaining parallel definitions in both
Factoryand theGetterstrait.Controllers: Records & Media Endpoints Split into Dedicated Classes
Request/response logic for
RecordsRequestHandlerandMediaRequestHandlerhas been broken out of the large monolithic handler classes and into individual endpoint classes under:src/Controllers/Records/Endpoints/src/Controllers/Media/Endpoints/Shared behavior (access control, error handling, template rendering, hooks) stays in the base handler. Endpoint-specific logic lives in its own class.
Dispatch is now centralized in
RequestHandler, which owns endpoint registration and__call()routing. Both records and media handlers register their endpoints against this shared mechanism. Media browse/delete routes use distinct method names to avoid colliding with the inherited record-level routes.SQL Schema Writers: Shared Base for Create Table Logic
The MySQL, PostgreSQL, and SQLite schema writers all shared the same create-table orchestration flow, repeated three times. That shared flow now lives in a common base class. Each backend writer is now focused exclusively on its backend-specific SQL rules.
Summary of Changes
FactoryandGetterstraitFactory/GettersclassesGetterstraitFactory(same public API)RequestHandlernotnullattributeNet: 2,871 lines added, 2,019 removed across 58 files — meaningfully less complexity with no breaking changes.