Here are two functions, one to get the object that calls the function that calls it, and one to get the calling function in the same way.
PHP Code:
function getcallingfunction() {
temp.callstack = getcallstack();
return temp.callstack[temp.callstack.size() - 3];
}
function getcallingobject() {
temp.callstack = getcallstack();
return temp.callstack[temp.callstack.size() - 3].scriptcallobject;
}