CRM-20455 - Add specialized event for queries
authorTim Otten <totten@civicrm.org>
Thu, 25 Jul 2019 01:02:15 +0000 (18:02 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 25 Jul 2019 01:02:15 +0000 (18:02 -0700)
commitb07c8672310da30f3480b663ad1693060d18a69f
tree058be3368b06ddc77b28445f128841190cbb6d5d
parentf4e89ad1cc71eb8baeed9b228a8183cbfa9890fd
CRM-20455 - Add specialized event for queries

Overview
--------

The recently merged PR for CRM-20455, https://github.com/civicrm/civicrm-packages/pull/180, uses the
GenericHookEvent for modifying all SQL queries.  GHE is flexible, but it
comes with a slight performance penalty (juggling a few internal arrays).
The penalty is usually too small to care if you're firing one hook. However, with CRM-20455,
we can foresee the event firing hundreds or even thousands of times within a given page-view.

This PR adds a smaller/simpler class for use with `modifyQuery`. There will be a different PR to use it.

Before
------

* Don't have `QueryEvent`

After
-----

* Do have `QueryEvent`
Civi/Core/Event/QueryEvent.php [new file with mode: 0644]