Parent Object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux