diff --git a/src/PersistentCollection.php b/src/PersistentCollection.php index ef5f28c3cb3..876a92a261a 100644 --- a/src/PersistentCollection.php +++ b/src/PersistentCollection.php @@ -509,7 +509,7 @@ public function __wakeup(): void */ public function first() { - if (! $this->initialized && ! $this->isDirty && $this->getMapping()['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { + if (! $this->initialized && ! $this->isDirty && $this->getMapping()->fetch === ClassMetadata::FETCH_EXTRA_LAZY) { $persister = $this->getUnitOfWork()->getCollectionPersister($this->getMapping()); return array_values($persister->slice($this, 0, 1))[0] ?? false;