Let's say I am using Doctrine ORM in my project (Doctrine is just an example, I am looking for a solution that would work with any class)
I want to intercept a call to Doctrine\ORM\EntityRepository::createQueryBuilder
So, if somewhere in my code (or in any other library code) is issued a call to that method, I want to execute some code before the execution of the called method.
Any PHP version is fine for me, I don't need a minimal compatibility.
I took a look here but the solution requires that I have control on the instantiation of classes which is definitely not my case.
Any one has a clue how to achieve this?
Thanks