diff --git a/src/Mapping/Driver/AbstractAnnotationDriver.php b/src/Mapping/Driver/AbstractAnnotationDriver.php index 43c92deae3..1eca100b1a 100644 --- a/src/Mapping/Driver/AbstractAnnotationDriver.php +++ b/src/Mapping/Driver/AbstractAnnotationDriver.php @@ -11,6 +11,7 @@ use Doctrine\Common\Annotations\Reader; use Doctrine\Deprecations\Deprecation; +use Doctrine\ORM\Mapping\FieldMapping; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\Mapping\Driver\MappingDriver; @@ -131,7 +132,9 @@ protected function isValidField($meta, $field) { $mapping = $meta->getFieldMapping($field); - return $mapping && in_array($mapping['type'], $this->validTypes, true); + $type = $mapping instanceof FieldMapping ? $mapping->type : $mapping['type']; + + return in_array($type, $this->validTypes, true); } /**