professional-php-05-factoryTest.php / php
<?php //use a valid studentid value from your student table try { objStudent = StudentFactory::getStudent(studentID doesn't exist in the database!"); } print objStudent->courses->exists('CS101') ? ' is ' : ' is not ') . 'currently enrolled in CS101'; //displays: "Bob Smith is enrolled in CS101" ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.