tags:

views:

22

answers:

1

Hello All, i m learning OOPS with JOOMLA... here sometimes i found difficulties to find the method used in some class... is there any way to find that this function is declared on this class or useful information about that function??

for exmaple

class testModeltest extends JModel
{
     function modifyCategory($data = array())

{ $image = $this->imageResize($value); ....... } }

now i want to know where the imageResize() function declared/defined first time...means class and file name where this function born

i used magic constact __METHOD__ this retrive useful information inside class . i need such type of function where i just put method name & i get the complete information of that function

i want a below kind of facility( i m sure there are some function in php to get the information about class but don't know )

functionInfo($methodname) // here i just put the function name

 which return

  Function Name:imageResize
  Main class : imageclass
  File name where it has been declared : /foldername/filename.php
  currenty using(called) in : thisclass::this function
+1  A: 

If you are looking for the place where a method was first defined, that should be possible using get_parent_class() - here is a snippet that walks through each class definition - and doing a method_exists() on each class found that way.

However, this will not show where the method has been subsequently overriden, so it may be of limited use to you - in that case, something like Reflection is probably indeed the only way.

Pekka