DDC-830: Missing prefix \ to switch to global space in Tools/EntityGenerator #1024

Open
opened 2026-01-22 12:59:14 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 7, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user hason:

If generated entity isn't in global namespace and extends class, name of extended class has to have prefix \ to switch to global namespace.

Fix: class Doctrine\ORM\Tools\EntityGenerator

private function _getClassToExtendName()
{
    $refl = new \ReflectionClass($this->_getClassToExtend());

    return '\\' . $refl->getName();
}
Originally created by @doctrinebot on GitHub (Oct 7, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user hason: If generated entity isn't in global namespace and extends class, name of extended class has to have prefix \ to switch to global namespace. Fix: class Doctrine\ORM\Tools\EntityGenerator ``` private function _getClassToExtendName() { $refl = new \ReflectionClass($this->_getClassToExtend()); return '\\' . $refl->getName(); } ```
admin added the Bug label 2026-01-22 12:59:14 +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#1024