Skip to content

Commit

Permalink
Merge pull request #413 from VincentLanglet/fixReferenceUpdate
Browse files Browse the repository at this point in the history
Fix reference update
  • Loading branch information
greg0ire authored Dec 23, 2022
2 parents fb3fa64 + 4da39a5 commit 1a4232c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Doctrine/Common/DataFixtures/ReferenceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ public function getReference($name, ?string $class = null)
$meta = $this->manager->getClassMetadata($class);

if (! $this->manager->contains($reference) && $identity !== null) {
$reference = $this->manager->getReference($meta->name, $identity);
$this->references[$name] = $reference; // already in identity map
$reference = $this->manager->getReference($meta->name, $identity);
$this->references[$name] = $reference; // already in identity map
$this->referencesByClass[$class][$name] = $reference; // already in identity map
}

return $reference;
Expand Down

0 comments on commit 1a4232c

Please sign in to comment.