DDC-1244: [regression] Entities generator fails to update entities without any namespace, always append the generated definitions to the end of the class #1853

Closed
doctrinebot opened this Issue Jul 1, 2011 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user venimus:

If Entities have no namespace set (e.g. custom AutoLoader) schema tool fails to find the original methods and properties and always append the definitions to the end of the file, which leads to duplications of class definitions.

This is because in \Doctrine\ORM\Tools\EntitiesGenerator.php at line 441:

441: $lastSeenClass = $lastSeenNamespace . '\\' . $token[1];

$lastSeenClass is always prefixed with "\" when checking for existing definitions

it could be fixed as:

441: $lastSeenClass = $lastSeenNamespace. ($lastSeenNamespace ? '\\' : '') . $token[1];

I had an environment where the classes without any specified namespace are autoloaded from Entities directory, which makes generate-entities fail to work properly since Doctrine 2.0.4

@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.1.1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment