Thank you for all of your help. As it turns out I was improperly calling the getter after initializing the class. I'll catch on eventually. Thanks again!
--- In [email protected], "balthork" <[EMAIL PROTECTED]> wrote: > Please excuse my idiocy with this, but if I can reply to get a grasp. > Have I confused the matter by creating $_iProfileID in the > getter/setter in the base class test and var $profileID in the > extended class extTest? Does this need to be defined as vars at the > beginning of the class (var $_iProfileID;) and get rid of the > $profileID in the extended class? Also, am I way off base with the > constructor in the extended class, is this the proper way to access > the base class? > > My initial example is simplified, each separate class has several > functions with the extended class building off of the base class. > > Thank you for your help!!! > > > --- In [email protected], "Mike Franks" <[EMAIL PROTECTED]> wrote: > > > > On 7/12/2005, "balthork" <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > Example > > class test { > > // Setters > > function setMemberID($iMemberID){ > > return $this->_iMemberID = $iMemberID; > > } > > > > function setProfileID($iProfileID){ > > return $this->_iProfileID = $iProfileID; > > } > > > > // Getters > > function getMemberID(){ > > return $this->_iMemberID; > > } > > > > function getProfileID(){ > > return $this->_iProfileID; > > } > > } > > > > class extTest extends Test { > > var $memberID; > > var $profileID; > > > > function extTest(){ > > $this->memberID = parent::getMemberID(); > > $this->profileID = parent::getProfileID(); > > } > > } > > > > > > > > > > > > > > > The vars need to be defined in the base class (test). Then, within > the > > extended class extTest, you can refer to the base class vars and > > functions as if they were defined in extTest: > > > > $this->getProfileID() > > > > I realize this is a simple, contrived example. In the real world, > you > > wouldn't bother extending test unless doing so gave you more vars or > > functionality. > > > > So, whatever is in the base class can be accessed from the extended > class > > "as if" it were defined in the extended class. > > > > Mike Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
