Or can we do that? It’s doesn’t look good too when you say:
$book = R::dispense('books');
and just handle the naming with an RedBean_IModelFormatter or am I missing something?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it, but it gets confusing and doesn’t look good. The standard convention is non-plural table names to make more sense when dispensing a book and storing a book, as well as with relation mapping. Imagine if you will the following:
That looks fine. Now lets say we load a page and go to fetch the associated book:
This doesn’t make as much sense and doesn’t quite fit what RedBean is after. Again, you can do it. If you have a database already set up, you may not want to make those changes. Again, it is all your decision and what you are trying to accomplish. If it is just you, then do whatever. If you are working in a group, it might make more sense to rename the tables so that your work is more legible.