Skip to content

v3.2.0

Choose a tag to compare

@hparadiz hparadiz released this 29 Mar 10:16
d8d49d5

What's Changed

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 the notnull column 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 under Factory/Getters. Factory is 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 Getters trait: nothing changes. Static calls like MyModel::getByField(...) continue to work exactly as before. Internally they now bubble through Factory, 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 Factory and the Getters trait.

Controllers: Records & Media Endpoints Split into Dedicated Classes

Request/response logic for RecordsRequestHandler and MediaRequestHandler has 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.

Full Changelog: v3.1.0...v3.2.0