DDC-552: Fatal error Undefined Method on ClassMetadataInfo::getReflectionClass() over CLI commands #687

Closed
opened 2026-01-22 12:46:52 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 28, 2010).

Originally assigned to: @jwage on GitHub.

Jira issue originally created by user guille:

When calling orm:generate-entities or orm:convert-mapping over cli I get following Fatal Error:

Fatal error: Call to undefined method Doctrine\ORM\Mapping\ClassMetadataInfo::getReflectionClass() in /vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php on line 132

PHP Version:

PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

Originally created by @doctrinebot on GitHub (Apr 28, 2010). Originally assigned to: @jwage on GitHub. Jira issue originally created by user guille: ## When calling orm:generate-entities or orm:convert-mapping over cli I get following Fatal Error: ## Fatal error: Call to undefined method Doctrine\ORM\Mapping\ClassMetadataInfo::getReflectionClass() in /vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php on line 132 ## PHP Version: PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies ## with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
admin added the Bug label 2026-01-22 12:46:52 +01:00
admin closed this issue 2026-01-22 12:46:52 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 28, 2010):

Comment created by romanb:

I think this is a known issue and will be fixed soon, I already talked with Jon about it.

@doctrinebot commented on GitHub (Apr 28, 2010): Comment created by romanb: I think this is a known issue and will be fixed soon, I already talked with Jon about it.
Author
Owner

@doctrinebot commented on GitHub (Apr 28, 2010):

Comment created by romanb:

If you want to fix it yourself preliminarily to get the tasks to work you may try the following hack in the AnnotationDriver:

if ($metadata instanceof ClassMetadata) {
    $class = $metadata->getReflectionClass();
} else {
    $class = new ReflectionClass($className);
}

It will be fixed in a more elegant way, however, but maybe this can do the trick in the meantime.

@doctrinebot commented on GitHub (Apr 28, 2010): Comment created by romanb: If you want to fix it yourself preliminarily to get the tasks to work you may try the following hack in the AnnotationDriver: ``` if ($metadata instanceof ClassMetadata) { $class = $metadata->getReflectionClass(); } else { $class = new ReflectionClass($className); } ``` It will be fixed in a more elegant way, however, but maybe this can do the trick in the meantime.
Author
Owner

@doctrinebot commented on GitHub (Apr 30, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Apr 30, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#687