You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JTI: updating a child entity dispatches OnCreate (never OnUpdate) to the parent role's listeners #42
With Joined Table Inheritance, when a loaded child entity is updated, EventDrivenCommandGenerator dispatches OnCreate to the parent role's listeners instead of OnUpdate. As a result, parent-level OnUpdate hooks never fire, and #[CreatedAt] on the parent overwrites created_at on every update of the child.
Reproduction
Runs on in-memory SQLite, ORM built with new EventDrivenCommandGenerator($schema, $container).
update: OnUpdate(role=person)
createdAt in DB after update: 2000-01-01 00:00:00
Actual
insert: OnCreate(role=person)
loaded createdAt: 2000-01-01
update: OnCreate(role=person)
createdAt in DB after update: 2026-09-29 13:24:31
Cause
src/EventDrivenCommandGenerator.php, generateParentStoreCommand() (lines 73-92): the event is always new OnCreate($parentRole, ...) (line 83), even when $isNew === false and the command is $mapper->queueUpdate(...). It should pick OnCreate/OnUpdate based on $isNew, as storeEntity() already does.
Activity
Apply verified review fixes across attributes and cycle-orm references