[eluser]Jamie Rumbelow[/eluser]
It was a bug... but a while ago. Take a look at the source, it should be protected $_table.
Jamie
[eluser]Mafagafo[/eluser]
I'm trying to use the version 1.1.1, but i'm having some dificulties:
- how I can retrieve just 2 columns using MY_Model?
For example, a table with 15 fields but I want to retrieve only 2 fields: name and date. How i can retrieve just these 2 fields? How i can format the date field with the format "%Y-%m-%d %H:%i:%s"?
-Can I use more than 1 argument to create a WHERE condition when I use methods like "get_by()" or "get_many_by()"?
This is a great tool. Congratulations. And sorry about my english.
[eluser]Buso[/eluser]
Hi, I need some advice on how to organize my models when using base models like the one you created.
Suppose I want to have a reusable cms/blog (something that allows me to create articles, comments, categories, links, tags, etc etc)
Would you create one model for each? Example: Article_m, Comment_m, Category_m, so you can have the table name auto-fetched most of the times?
Or one big model that handles everything?
If each Article has many Comments.. Which model should handle the articles_comments table? (supposing I want to have this sepparate table. Or just imagine any many-to-many situation)
Thanks in advance!
[eluser]Jamie Rumbelow[/eluser]
This is more of a generic MVC question, and always the former! Keep things as separated as possible. When dealing with relationships, try to have a "parent" and "child" (in your case, parent is Article), and have the parent handle the relationships.
Hope this helps,
Jamie
[eluser]Buso[/eluser]
It's just that I never see things like subdirectories inside /models. All the libraries I have seen, they always come with 1 big library, and 1 big model.
Well thanks for your answer, I guess I have to try this method (separate everything) and see what happens.