For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2007 > Inheritance question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Inheritance question
Craig Hoffman

2007-03-19, 7:00 pm

Hi there,
I could use some help in understanding inheritance and accessing
certain properties in objects.
For example (see below), lets say I would like to use "public $one"
property in a new class / method (such as class b)? What is the
best way to accomplish this? Any help and or suggestions are welcome.

class a {
public $one;

public function someMethod() {
$this->one = '1';
}
}

class b {
public $two

function someOtherMethod() {
$this->two = '2';
}
}

- CH
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com