Feature: #106510 - Added PSR-14 events to Extbase Backend::getObjectCountByQuery method

See forge#106510

Description

The class \TYPO3\CMS\Extbase\Persistence\Generic\Backend is the covering entity to retrieve data from the database within the Extbase persistence framework.

Already in 2013 the getObjectDataByQuery method got equipped with signals (later migrated to events) in order to modify data retrieval.

Especially when used in combination with Extbase's QueryResult there is also a second important method getObjectCountByQuery, which is often used in combination with Fluid.

Extensions, or any other code using the existing events for data retrieval, have not been able to consistently modify queries, such that results returned by QueryResult were consistent.

The getObjectCountByQuery method is now enhanced with events as well. This finally allows extensions to modify all parts of query usage within Extbase's generic Backend to achieve consistent results.

The new events are:

  • \TYPO3\CMS\Extbase\Event\Persistence\ModifyQueryBeforeFetchingObjectCountEvent may be used to modify the query before being passed on to the actual storage backend.
  • \TYPO3\CMS\Extbase\Event\Persistence\ModifyResultAfterFetchingObjectCountEvent may be used to adjust the result.

Typically, an extension will want to implement events pair-wise: ModifyQueryBeforeFetchingObjectCountEvent together with ModifyQueryBeforeFetchingObjectDataEvent, and ModifyResultAfterFetchingObjectCountEvent together with ModifyResultAfterFetchingObjectDataEvent