PHP static::DerivedClassName

ironfeather

New Member
Is there any way to get the Derived Class Name from static Keyword ?What I actually want to do is.Make a Reflection of the Derived Class
Check Wheather it implements the Specified Class or notI've a static method the Base Class say its named \[code\]Base::check()\[/code\]I want \[code\]Base::check()\[/code\] will check for the existence of the Interface Implementation.the check() method knows the name of the interface.so I don't need to tell it from outer world.But if there is no way to get DerivedClassName from static Keyword I need to pass the Class Name to the method from the outer world. Which is not a good Coding Principle.Another Alternative I can do is. I can make an \[code\]::instance()\[/code\] static method that returns the \[code\]this\[/code\] and I can do a get_class from its return. But this also tweeks my Application Principle.So is the first method really possible ? or I need to go for some alternative of this kind ?Or Do you have any other kind of Alternatives ?
 
Back
Top