Class "xxx" is not a valid entity or mapped super class. #6731

Closed
opened 2026-01-22 15:37:40 +01:00 by admin · 5 comments
Owner

Originally created by @ThibaultVlacich on GitHub (May 25, 2021).

I'm trying to use the new PHP 8 Attributes coming with ORM 2.9, but as soon as I modify

/**
 * @ORM\Entity(repositoryClass="App\Repository\VideoRepository")
 */

for

#[ORM\Entity(repositoryClass: VideoRepository::class)]

I'm getting this error In MappingException.php line 378: Class "App\Entity\Video" is not a valid entity or mapped super class. when trying to generate diffs (php bin/console doctrine:migrations:diff).

Is the migration bundle incompatible with those new PHP8 attributes, or is there a bug with the implementation (because the error, MappingException, comes from ORM).

Originally created by @ThibaultVlacich on GitHub (May 25, 2021). I'm trying to use the new [PHP 8 Attributes coming with ORM 2.9](https://www.doctrine-project.org/2021/05/24/orm2.9.html), but as soon as I modify ```php /** * @ORM\Entity(repositoryClass="App\Repository\VideoRepository") */ ``` for ```php #[ORM\Entity(repositoryClass: VideoRepository::class)] ``` I'm getting this error `In MappingException.php line 378: Class "App\Entity\Video" is not a valid entity or mapped super class.` when trying to generate diffs (`php bin/console doctrine:migrations:diff`). Is the migration bundle incompatible with those new PHP8 attributes, or is there a bug with the implementation (because the error, MappingException, comes from ORM).
admin closed this issue 2026-01-22 15:37:40 +01:00
Author
Owner

@saxap commented on GitHub (May 26, 2021):

got same issue

@saxap commented on GitHub (May 26, 2021): got same issue
Author
Owner

@michaljusiega commented on GitHub (May 26, 2021):

Because:
1.) In your configuration to Doctrine Bundle you are using AnnotationDriver to mapping your entities.
2.) ORM 2.9 has AttributeDriver.
3.) DoctrineBundle will be soon release marked as 2.4 to make full compatibility with ORM 2.9

@michaljusiega commented on GitHub (May 26, 2021): Because: 1.) In your configuration to Doctrine Bundle you are using AnnotationDriver to mapping your entities. 2.) ORM 2.9 has AttributeDriver. 3.) DoctrineBundle will be soon release marked as 2.4 to make full compatibility with ORM 2.9
Author
Owner

@ben29 commented on GitHub (May 26, 2021):

Because:
1.) In your configuration to Doctrine Bundle you are using AnnotationDriver to mapping your entities.
2.) ORM 2.9 has AttributeDriver.
3.) DoctrineBundle will be soon release marked as 2.4 to make full compatibility with ORM 2.9

When the bundle will release? Any ETA?

@ben29 commented on GitHub (May 26, 2021): > Because: > 1.) In your configuration to Doctrine Bundle you are using AnnotationDriver to mapping your entities. > 2.) ORM 2.9 has AttributeDriver. > 3.) DoctrineBundle will be soon release marked as 2.4 to make full compatibility with ORM 2.9 When the bundle will release? Any ETA?
Author
Owner

@michaljusiega commented on GitHub (May 27, 2021):

Because:
1.) In your configuration to Doctrine Bundle you are using AnnotationDriver to mapping your entities.
2.) ORM 2.9 has AttributeDriver.
3.) DoctrineBundle will be soon release marked as 2.4 to make full compatibility with ORM 2.9

When the bundle will release? Any ETA?

References:
https://github.com/doctrine/DoctrineBundle/pull/1354
https://github.com/doctrine/DoctrineBundle/pull/1353

@michaljusiega commented on GitHub (May 27, 2021): > > > > Because: > > 1.) In your configuration to Doctrine Bundle you are using AnnotationDriver to mapping your entities. > > 2.) ORM 2.9 has AttributeDriver. > > 3.) DoctrineBundle will be soon release marked as 2.4 to make full compatibility with ORM 2.9 > > When the bundle will release? Any ETA? References: https://github.com/doctrine/DoctrineBundle/pull/1354 https://github.com/doctrine/DoctrineBundle/pull/1353
Author
Owner

@ThibaultVlacich commented on GitHub (May 27, 2021):

I'm closing since this is related to doctrine-bundle, and will soon be released it seems like

@ThibaultVlacich commented on GitHub (May 27, 2021): I'm closing since this is related to doctrine-bundle, and will soon be released it seems like
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6731