-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Table::name() #5984
Implement Table::name() #5984
Conversation
The name of a table is _usually_ the class name. However, for automatic models it's normally derived from the database table the table object is pointing at.
How do you see this being used? Does the table name need to be mutable? It seems like the kind of thing that shouldn't be modified. |
See the discussion in the translate behavior about alias/'model' usage (if the link doesn't work - expand the outdated-diff).
I don't think so, though I made it so as a separate commit (which I can rebase out) just in case. |
If name() doesn't need to be mutable right now. I would leave it as immutable until a good use case comes up. |
Ok, I removed the ability to change name. |
I'm not convinced of the use case for this, wouldn't the problem for the translate behavior be solved by using the registryAlias instead. Having 3 different names for the same object seems like too much for me |
After discussing with Jose, not merging this and instead implementing it directly in the translate behavior as it's the only known use case. Having I'm sceptical we won't need this - but if/when it proves necessary, we can simply resurrect this PR. |
We don't currently have a means to know the table name, accounting for auto-table instances.