I see Controllers as a place where I can receive HTTP Requests and Views as a means to return XHTML/XML/JSON, etc, but I have yet to get my head around Models. From any MVC best practice guides I've read (and there has been many), it seems people are pushing a lot of their code in to Models.
The majority of web applications will use databases for persisting data beyond sessions, yet all of the example code I've seen from tutorials online is extremely basic in that you end up mapping an object directly to a single table. A lot of my select queries would typically return a ResultSet that comprises of data from multiple tables, and includes things like specific MySQL functions, etc. I know it's not the most portable approach, but I don't have a need to move database vendors. This idea of mapping an object to a single table and just running queries on that appears fantastic, but I can't see how it would be of any use beyond the most basic of database designs and applications.
In any one application the sheer number of select queries alone that I could run against a database could span hundreds of unique query types. Would it mean that I would need to create a Model that represents the results from each those queries that I need (which seems like an awful lot of code, just to be able to have an object oriented view of DB interaction).
However I think that my understanding of Models and how I can use them to interact with databases using the Zend Framework is way off the mark, and I beg someone to please help me understand how this works.
I would consider myself a reasonably proficient programmer and have been using PHP for a few years, but I have still to get my head around MVC and Zend. I am tired of re-inventing the wheel and would love to take advantage of the solid foundations that the Zend Framework provides for my current/future apps.
any help appreciated