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/
 


Reply via email to