I'm working on a project, but I would like others' opinions on how to organize my classes / objects.
I have three main objects: Volume, Issue and Article.
Articles are "contained" inside of an Issue. Issues are "contained" in a Volume. The relationships are made through a foreign key in the database.
If I want to retrieve a single record of either an Article, Issue or Volume, that's fine.
$ArticleObj->GetData($article_id);
But what if I want to retrieve all Articles are that belong to a specific Issue? Would I do this?
$IssueObj->GetArticles($issue_id)
The problem I'm running into is this: What happens when I get to Volume? The Volume object is only supposed to contain the information for one volume. But what if I want to retrieve ALL of the volumes? Would I have to do that outside of the Volume class? And when I return single records (such as a single article), should I return the information as an assoc array or as an Article Object?
Any help is much appreciated.