I'm trying to implement a plugin API in a PHP-based product I'm working on. I created a class that inherits from PHP's PDO class and then added some extra methods. Trouble is, I want to intercept things like PDO's .query(), .exec(), .execute(), and .fetchAll() in the plugin API, handling the arguments passed to/from those methods. I tried using the __call($method,$args) interceptor technique, but it won't work in this case because I have no way to mark the PDO methods as protected.
How do I make a class that inherits from PDO, and then intercept PDO class methods before they are sent off to the parent class? The goal is to intercept arguments passed to/from those methods so that my plugin API will work. This is the missing piece I don't have in my plugin API for the product I'm working on.