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

Closed
opened 2026-01-22 13:33:58 +01:00 by admin · 3 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:58 +01:00
admin closed this issue 2026-01-22 13:34:02 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 28, 2011):

Comment created by @beberlei:

getIdentifierValues() uses reflection, and reflection code is exclusively in ClassMetadata.

The code here smells badly related to this distinction but i havent came up with a refactoring yet that solves this mess.

@doctrinebot commented on GitHub (Dec 28, 2011): Comment created by @beberlei: getIdentifierValues() uses reflection, and reflection code is exclusively in ClassMetadata. The code here smells badly related to this distinction but i havent came up with a refactoring yet that solves this mess.
Author
Owner

@doctrinebot commented on GitHub (Dec 29, 2011):

Comment created by @beberlei:

This is foremost a bug in Gedmos library, he hints for a ClassMetadata where none is expected.

@doctrinebot commented on GitHub (Dec 29, 2011): Comment created by @beberlei: This is foremost a bug in Gedmos library, he hints for a ClassMetadata where none is expected.
Author
Owner

@doctrinebot commented on GitHub (Dec 29, 2011):

Issue was closed with resolution "Can't Fix"

@doctrinebot commented on GitHub (Dec 29, 2011): Issue was closed with resolution "Can't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1965