Parent Object
| From: | Ralph Kutschera | Date: | Wed, 01 Aug 2007 12:18:55 +0000 |
| Subject: | Parent Object | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-259983@lists.php.net to get a copy of this message | ||
Hallo!
class A {
...
}
class B extends A {
...
$name = get_parent_class($this); // would be "A"
...
}
This is *not* what I want!
class B {
...
$name = get_parent_class2($this); // should give "A"
...
}
class A {
...
$b = new B();
...
}
This *is* what I want!
How can i resolve this issue? I don't want to know which class is being
inherited, but I'd like to know which class has created the current object.
TIA, Ralph