mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #11652] Add support for ReflectionClass::newLazyGhost of PHP 8.4 #13159
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/11652
State: closed
Merged: No
Our goal is that we can completely replace all kinds of code for proxy generation and proxy usage with the new lazy objects feature of PHP 8.4: https://wiki.php.net/rfc/lazy-objects
In 3.x we can add support for optionally using lazy objects, and in 4.x we increase the requirement for PHP to 8.4 and automatically always use lazy objects.
The benefit of lazy objects is that we don't need code-generation anymore, and that it also allows us to treat partial objects as lazy objects that can load their missing properites only when accessed.
Todos
ClassMetadata::$reflFieldsto a new abstractionPropertyAccessorthat avoids us having to extend ReflectionProperty for our edge cases (enums, typed no default, embedded, ....).See #11659 for those prerequisites.
Future
As a next step this also allows us to implement a feature to mark properties as lazy, meaning that they are never fully fetched on the first query unless specify in the query (query hint? dql keyword?).