Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Extension/EagerLoadingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
use ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\JoinColumnMapping;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\Query\Expr\Select;
use Doctrine\ORM\QueryBuilder;
Expand Down Expand Up @@ -181,7 +182,7 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt
$associationAlias = $existingJoin->getAlias();
$isLeftJoin = Join::LEFT_JOIN === $existingJoin->getJoinType();
} else {
$isNullable = $mapping['joinColumns'][0]?->nullable ?? true;
$isNullable = isset($mapping['joinColumns']) && isset($mapping['joinColumns'][0]) ? ($mapping['joinColumns'][0] instanceof JoinColumnMapping ? $mapping['joinColumns'][0]->nullable : $mapping['joinColumns'][0]['nullable']) : true;
$isLeftJoin = false !== $wasLeftJoin || true === $isNullable;
$method = $isLeftJoin ? 'leftJoin' : 'innerJoin';

Expand Down