DDC-1565: ClassMetadataInfo must implements the Doctrine\Common\Persistence\Mapping\ClassMetadata interface #1962

Open
opened 2026-01-22 13:33:51 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 25, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user dunglas:

The doctrine:generate:entities command from Symfony 2 fails when using Doctrine Extensions (i.e. Timestampable) with this error :

[ErrorException]
Catchable Fatal Error: Argument 2 passed to Gedmo\Mapping\MappedEventSubscriber::loadMetadataForObjectClass() must implement interface Doctrine\Common\Persistence\Mapping\ClassMetadata, instance of Doctrine\ORM\Mapping\ClassMetadataInfo given, called in /Users/dunglas/Documents/workspace/DoctrineExtensions/lib/Gedmo/Timestampable/TimestampableListener.php on line 44 and defined in /Users/dunglas/Documents/workspace/DoctrineExtensions/lib/Gedmo/Mapping/MappedEventSubscriber.php line 171

The error should also occurs without using Symfony because it's related to Doctrine and Doctrine Extensions.

In Doctrine MongoDB ODM this is ClassMetadataInfo that implements the Doctrine\Common\Persistence\Mapping\ClassMetadata and the problem does not occurs.

To do this the getIdentifierValues method of ClassMetadata must be moved to ClassMetadataInfo.

Originally created by @doctrinebot on GitHub (Dec 25, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user dunglas: The `doctrine:generate:entities` command from Symfony 2 fails when using Doctrine Extensions (i.e. Timestampable) with this error : [ErrorException] Catchable Fatal Error: Argument 2 passed to Gedmo\Mapping\MappedEventSubscriber::loadMetadataForObjectClass() must implement interface Doctrine\Common\Persistence\Mapping\ClassMetadata, instance of Doctrine\ORM\Mapping\ClassMetadataInfo given, called in /Users/dunglas/Documents/workspace/DoctrineExtensions/lib/Gedmo/Timestampable/TimestampableListener.php on line 44 and defined in /Users/dunglas/Documents/workspace/DoctrineExtensions/lib/Gedmo/Mapping/MappedEventSubscriber.php line 171 The error should also occurs without using Symfony because it's related to Doctrine and Doctrine Extensions. In Doctrine MongoDB ODM this is `ClassMetadataInfo` that implements the `Doctrine\Common\Persistence\Mapping\ClassMetadata` and the problem does not occurs. To do this the `getIdentifierValues` method of `ClassMetadata` must be moved to `ClassMetadataInfo`.
admin added the Bug label 2026-01-22 13:33:51 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1962