[PR #1538] Check if identityMap contains entity in UnitOfWork::getEntityIdentifier() to prevent "Undefined index" notice #9596

Open
opened 2026-01-22 16:04:48 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/1538

State: closed
Merged: No


Some people use UnitOfWork directly and could run into this issue. Seems nicer to throw an exception with an explanation, so they could find an error in their code faster without necessity to look through library code for the source of notice.
Also, if notices are disabled in php.ini (in production enviroment, for example), this method will return null and probably lead to undefined behavior.

**Original Pull Request:** https://github.com/doctrine/orm/pull/1538 **State:** closed **Merged:** No --- Some people use UnitOfWork directly and could run into this issue. Seems nicer to throw an exception with an explanation, so they could find an error in their code faster without necessity to look through library code for the source of notice. Also, if notices are disabled in php.ini (in production enviroment, for example), this method will return null and probably lead to undefined behavior.
admin added the pull-request label 2026-01-22 16:04:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9596