[PR #6548] ManyToManyPersister should detect columnName #10030

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

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

State: closed
Merged: No


Hey guys,

I recently realized that if you want to apply a criteria on a PersistentCollection by using the ManyToManyPersister, the criteria MUST contain the field name relating to the database.

Since we are always using property names, I got some error on ManyToMany (SQL Error: Missing fieldname).

I just wanted to add the ClassMetadata::getColumnName logic to the ManyToManyPersister::loadCriteria method so if someone applied the property name, it maps to the expected column name.

This was already applied in master: ManyToManyPersister.php#L263
Would love to see this in some of the next minor releases.

**Original Pull Request:** https://github.com/doctrine/orm/pull/6548 **State:** closed **Merged:** No --- Hey guys, I recently realized that if you want to apply a criteria on a `PersistentCollection` by using the `ManyToManyPersister`, the criteria MUST contain the field name relating to the database. Since we are always using property names, I got some error on ManyToMany (SQL Error: Missing fieldname). I just wanted to add the `ClassMetadata::getColumnName` logic to the `ManyToManyPersister::loadCriteria` method so if someone applied the property name, it maps to the expected column name. This was already applied in `master`: [ManyToManyPersister.php#L263](https://github.com/doctrine/doctrine2/blob/74c48c201dc5284688210872fdb546897de8eba9/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php#L263 ) Would love to see this in some of the next minor releases.
admin added the pull-request label 2026-01-22 16:06:11 +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#10030