I am building a team roster application. It takes a team class (this is a quick mockup not the actual class as my question does not pertain to it)
class Team {
function __construct($teamName, $roster){
$this->setName($teamName);
$this->setRoster($roster);
}
I didn't include the set functions because this class is the foundation for my question. I want to add a section to comment on each person in the roster. Example:
$roster = array('Jim','Bob','Steve','Josh');
$team = new team('My Team', $roster);
I want each person on the team to have a section where someone can comment on them. Example:
My Team
- id:1 Jim - add comment
- id:2 Bob - add comment
Bob needs to come to more practices - delete comment - id:3 Steve - add comment
- id:4 Josh - add comment
My question is this; do I create a comment class and then create a new class for each person? I would think that this would be a bad idea if their where 100+ people. Or do I create functions in my team class to handle the commenting?