I have a class Injector whichs uses get_class($this) to get the class using Injector, to load some data in the class from db or file … it works great with simple inheritance like class User extends Injector.
The problem is: if a class SpecialUser extends User, get_class returns only SpecialUser and User will not filled with needed data. Is there a better solution then loop trouth the classes with get_parent_class()?
thanks
You could use the following:
Here’s an example of its usage.