mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1943: entity generator fails for DB columns starting with a digit #2452
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 24, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user didi_bcg:
Using it with Symfony 2, I used the generator to build the entity code.
One column in the DB was named "8cities".
The command
php app/console doctrine:generate:entities BcgSomeBundle
failed with
PHP Parse error: syntax error, unexpected '$', expecting variable (T_VARIABLE) in /var/www/somedir/src/Bcg/SomeBundle/Entity/City.php on line 148
@doctrinebot commented on GitHub (Jul 25, 2012):
Comment created by @ocramius:
Is this a valid use case? This requires some kind of "reverse" naming strategy...
Not even sure I'd like to see support for this, since it seems to be a huge overhead for little to no benefit...
A quick fix is possible by acting in https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Util/Inflector.php, but it feels wrong.
I'm -1 for supporting this at all :)
@doctrinebot commented on GitHub (Jul 25, 2012):
Comment created by didi_bcg:
I don't know if it's a valid use case, but I guess so. At least MySql allowed me to name a column like this.
Just wanted to report, For me I could easily solve it bcs I didn't need this column anyway.
Do with the ticket whatever you think is appropriate :-)
@doctrinebot commented on GitHub (Jul 25, 2012):
Comment created by @ocramius:
[~didi_bcg] indeed, Doctrine shouldn't try to fix problems that come from misuse in my opinion. Won't fix.
@doctrinebot commented on GitHub (Jul 25, 2012):
Issue was closed with resolution "Won't Fix"