RedBeanPHP uses class naming convention to tie a model to a table. I can’t abide by that naming convention since I have a project where table names aren’t set in stone. I need a way to connect a RedBean_SimpleModel to a table name without the naming convention – How do I do that?
RedBeanPHP uses class naming convention to tie a model to a table. I can’t
Share
OK, I found one solution while going through the API documentation. I can set my own “Model Formatter”, which just means that I can create a class that is given the responsibility of connecting the name of a table with the name of a class. My RedBean setup code now looks like this:
It’s a bit of an ugly solution. I would much rather be able to do something like this:
For that reason I will hold off on marking this as the correct answer for a while.