Your Modelname.class.php file holds the container class, for example Post. This class has all the methods and properties of one row in your table, for example the Post table. If you have columns in the table like id, text, etc., you will be able to access them through the Post class.
However, your PostTable (or XxxxxTable class) is the table reference, meaning that this class should be responsible for querying the table to fetch the data.
Let me give a brief example. Lets say you wish to pull out a single post from the table and then edit that.
First, you would do like $post = Doctrine::getTable('Post')->findOneById(1);
This is done from the table class because you'll want to pull out some data from a specific table.
Now you have your post (as in a Post object), because ->findOneById(...)
queried the database for you. Then you can edit that, for example with $post->title = "a nice title"
. Finally, save your post with $post->save();
.
Exceptions to this is when you want to fetch related objects, which for example could be replies to your post. This would be done through the object you already pulled out to $post
.
I hope I made my point clear - if not, please do not hesitate to ask further questions.