Skip to content

Commit

Permalink
allow ManyToMany associations with referenced column name different f…
Browse files Browse the repository at this point in the history
…rom 'id'
  • Loading branch information
Vladimir Klimes committed Jul 19, 2024
1 parent d5a014b commit d058a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AuditReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ private function createEntity($className, array $columnMap, array $data, $revisi
foreach (self::getRelationToSourceKeyColumns($assoc) as $sourceKeyJoinColumn => $sourceKeyColumn) {
$whereId[] = "{$sourceKeyJoinColumn} = ?";

$reflField = $classMetadata->reflFields['id'];
$reflField = $classMetadata->reflFields[$classMetadata->getFieldName($sourceKeyColumn) ?? 'id'];
\assert(null !== $reflField);

$values[] = $reflField->getValue($entity);
Expand Down

0 comments on commit d058a8f

Please sign in to comment.