DDC-3335: Merge with value object causes notice #4121

Closed
opened 2026-01-22 14:35:31 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Oct 3, 2014).

Originally assigned to: @Majkl578 on GitHub.

Jira issue originally created by user ddeboer:

This:

// Assume Location is some value object
$valueObject = new Location(); // or e.g. new \stdClass()
$em->merge($valueObject);

causes this:

Notice: Undefined offset: 0 in /vagrant/api/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 729

While I agree merge shouldn't work for value objects, wouldn't it be better to throw an exception when ClassMetadataInfo tries to find an identifier that isn't there?

Originally created by @doctrinebot on GitHub (Oct 3, 2014). Originally assigned to: @Majkl578 on GitHub. Jira issue originally created by user ddeboer: This: ``` // Assume Location is some value object $valueObject = new Location(); // or e.g. new \stdClass() $em->merge($valueObject); ``` causes this: ``` Notice: Undefined offset: 0 in /vagrant/api/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 729 ``` While I agree merge shouldn't work for value objects, wouldn't it be better to throw an exception when ClassMetadataInfo tries to find an identifier that isn't there?
admin added the BugWon't Fix labels 2026-01-22 14:35:31 +01:00
admin closed this issue 2026-01-22 14:35:31 +01:00
Author
Owner

@Majkl578 commented on GitHub (Dec 19, 2017):

Merge will be dropped in Doctrine 3.0.

@Majkl578 commented on GitHub (Dec 19, 2017): Merge will be dropped in Doctrine 3.0.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4121