I have a Dbh class, a Person Class and a StudentCollection Class.
On my index.php page I include all 3 classes.
What I want to do is when I create a new StudentCollection instance, I want it to populate all my students automatically.
$StudentList = new StudentList();
Currently I'm doing this.
$StudentList = new StudentList->getStudents();
As my database query and loop is inside a getStudents public function.
The reason I want to do this is so I can have another method, findStudent which allows me to do something like this
$Student = $StudentList->findById(34);
Which will used the list created when StudentCollection was created.