Skip to content

Commit

Permalink
Merge pull request #11368 from greg0ire/address-deprecation
Browse files Browse the repository at this point in the history
Avoid array access
  • Loading branch information
greg0ire authored Mar 17, 2024
2 parents b0d07ff + 5820bb8 commit c5315f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2662,13 +2662,13 @@ private function eagerLoadCollections(array $collections, ToManyInverseSideMappi
foreach ($found as $targetValue) {
$sourceEntity = $targetProperty->getValue($targetValue);

if ($sourceEntity === null && isset($targetClass->associationMappings[$mappedBy]['joinColumns'])) {
if ($sourceEntity === null && isset($targetClass->associationMappings[$mappedBy]->joinColumns)) {
// case where the hydration $targetValue itself has not yet fully completed, for example
// in case a bi-directional association is being hydrated and deferring eager loading is
// not possible due to subclassing.
$data = $this->getOriginalEntityData($targetValue);
$id = [];
foreach ($targetClass->associationMappings[$mappedBy]['joinColumns'] as $joinColumn) {
foreach ($targetClass->associationMappings[$mappedBy]->joinColumns as $joinColumn) {
$id[] = $data[$joinColumn['name']];
}
} else {
Expand Down

0 comments on commit c5315f8

Please # to comment.