mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1244: [regression] Entities generator fails to update entities without any namespace, always append the generated definitions to the end of the class #1569
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jul 1, 2011).
Originally assigned to: @beberlei on GitHub.
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 commented on GitHub (Jul 12, 2011):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Jul 12, 2011):
Issue was closed with resolution "Fixed"