mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Weird entity naming in cli "orm:convert:mapping" #5358
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 @igorfialko on GitHub (Dec 21, 2016).
Originally assigned to: @Ocramius on GitHub.
Due to strtolower
in
protected function getClassNameForTable($tableName)
in
DatabaseDriver
table names from DB in camel case will be entities like "Userpasshistory"
@Ocramius commented on GitHub (Dec 21, 2016):
That is normal when converting from snake case to StudlyCaps: seems
expected to me.
On 21 Dec 2016 2:41 p.m., "ifif14" notifications@github.com wrote:
@igorfialko commented on GitHub (Dec 22, 2016):
yes, table names in snake_case will be StudlyCaps, which is okay. but StudlyCase table names will be capitalized lower cases php class names. I would expect here, that table like ShopProduct will be class ShopProduct and not Shopproduct as current, since it's OOP convention.
At first I was looking at NamingStrategy to adjust this and ended up extending EntityGenerator and DatabaseDriver.
Maybe it makes sense to delegate this, alongside with column -> field conversion into NamingStrategy interface?
@Ocramius commented on GitHub (Dec 23, 2016):
Seems unnecessary, when some manual tweaking on the mappings is sufficient.
Consider that mapping import operations are only to be applied once, when importing legacy schemas.
Closing as
won't fix, since it is not primary focus.