I'm trying to get a little more familiar with writing extensions. I am still struggling with finding the correct / most specific hook function for my patches regularly.
As a specific example, I am altering an SQL call in sites/all/modules/civicrm/CRM/Case/BAO/Case.php::getCaseActivity(). So if I want to create an extension for that, I would need a hook function that will be called whenever sth is read from a database table. I checked all the hooks in https://docs.civicrm.org/dev/en/latest/hooks/ but couldn't find a suitable one.
Is there a hook function like that? Is there a more specific alternative to save resources (checking the hook extension each time a database table is called would happen lots of times)?
Can I create custom hook "call points" to determine at which line of code a hook is called?