DDC-1943: entity generator fails for DB columns starting with a digit #2452

Closed
opened 2026-01-22 13:53:51 +01:00 by admin · 4 comments
Owner

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

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
admin added the Bug label 2026-01-22 13:53:51 +01:00
admin closed this issue 2026-01-22 13:53:52 +01:00
Author
Owner

@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 @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 :)
Author
Owner

@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 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 :-)
Author
Owner

@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): Comment created by @ocramius: [~didi_bcg] indeed, Doctrine shouldn't try to fix problems that come from misuse in my opinion. Won't fix.
Author
Owner

@doctrinebot commented on GitHub (Jul 25, 2012):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (Jul 25, 2012): Issue was closed with resolution "Won't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2452