Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297969

Convert select query extenders to backend-overrideable services

$
0
0

Problem/Motivation

While working on #3217531: Deprecate usage of Connection::getDriverClass for some classes, and use standard autoloading instead, we came across the fact that Connection::getDriverClass is also used to resolve overrides to select query extenders. This is not easily solvable with direct autoloading because the to-be-overridden class resides outside of the database driver namespaces; also, while the db driver specific classes are all necessarily extensions of the Core\Database ones, the extenders may be freely added by any module.

Proposed resolution

Try using backend-overrideable services, adding a factory for each extender that will then instantiate extender objects.

Remaining tasks

Needs followup, see #58

User interface changes

None

API changes

Using the full class name as the parameter value in the method Drupal\Core\Database\Query\Select::extend() has been deprecated. Also the method Drupal\Core\Database\Connection::getPagerManager() has been deprecated.

Data model changes

None

Release notes snippet

Select query extenders are now managed through backend-overrideable services. When extending a query, consuming code needs to switch from hardcoding the extension class to calling the extender service with the type of extension required. Contrib and custom database drivers overriding the extenders need to implement their own service. See https://www.drupal.org/node/3218001


Viewing all articles
Browse latest Browse all 297969

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>