I got this class:
Class Username {
protected $id;
protected $username;
protected $contact_information;
private __construct($id) {
$this->id = (int) $id; // Forces it to be a string
$contact_information = new ContactInformation($this->id);
}
}
Class ContactInformation extends Username {
protected $mobile;
protected $email;
protected $nextel_id;
.....
}
My problem is: I want to access the $id and $username (and lots of other variables) on ContactInformation, but parent:: or $this-> does NOT work, looks like everytime i do "new ContactInformation....) PHP creates a "new Username". Any chance to access the CURRENT values from Username?
Thanks
See Question&Answers more detail:os