final class Entity: Doctrine Mapping for Modern PHP
For fifteen years Doctrine shaped how we write entities, and not always for the better. Entities could not be final, because proxies had to extend them. Every field grew a getter and a setter. Money, addresses and identifiers ended up as strings and floats, because mapping anything richer cost more than it was worth. None of that was a design decision. They were workarounds for things PHP could not express.
It can now: attributes, backed enums, property hooks, asymmetric visibility, native lazy objects, arbitrary-precision numbers in core. Doctrine ORM 3.4 and DBAL 4.3 pick all of it up, and ORM 4 is built on it.
We take one realistic entity, too many accessors and primitives, and refactor it live on the slides: final classes, no setters, typed identifiers, embedded value objects, self-registering DBAL types. Same schema. No migration. Considerably less code.
Date/time to be announced