Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $letter = new acceptance_letter( "student", system::get_value("schoolyear"));
- $student->add_acceptance_letter( $letter );
- $student->get_acceptance_letter( "student", system::get_value("schoolyear") );
- public class Acceptance_Letter
- {
- private $type;
- private $year;
- public __construct( $type, $year )
- {
- $this->type = $type;
- $this->year = $year;
- }
- public get_type(){ return type; }
- public get_year(){ return year; }
- }
- ....
- in student
- public get_acceptance_letter( $type, $year )
- {
- foreach( $this->acceptance_letters as $letter )
- {
- $the_type = $letter->get_type();
- $the_year = $letter->get_year();
- if( type == the_type && year == the_year )
- {
- // found it !
- return $letter;
- }
- }
- }
Add Comment
Please, Sign In to add comment