At the very least, you could use debug_backtrace and analyze that to find the calling method.
I think you should also be able to do it using the reflection API, but it's been too long since I've used PHP and I don't remember exactly how. The links should at least get you started, however.