Problem/Motivation

The entity query system (and possibly the main query system too) work with a list of namespaces to find the right class:

    $this->namespaces = QueryBase::getNamespaces($this);

...

    $class = QueryBase::getClass($this->namespaces, 'Query');

This needs documenting, as it's a little bit convoluted.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3353693

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

joachim’s picture

There is some documentation in \Drupal\Core\Entity\Query\Sql\pgsql\QueryFactory:

 * To add a new query implementation extending the default SQL one, add
 * a service definition like pgsql.entity.query.sql and a factory class like
 * this. The system will automatically find the relevant Query, QueryAggregate,
 * Condition, ConditionAggregate, Tables classes in this namespace, in the
 * namespace of the parent class and so on. So after creating an empty query
 * factory class like this, it is possible to just drop in a class extending
 * the base class in this namespace and it will be used automatically but it
 * is optional: if a class is not extended the relevant default is used.
 *
 * @see \Drupal\Core\Entity\Query\QueryBase::getNamespaces()
 * @see \Drupal\Core\Entity\Query\QueryBase::getClass()

but it doesn't explain the implementation details and it's hard to find!

rckstr_rohan made their first commit to this issue’s fork.

joachim’s picture

Status: Active » Needs work

Thanks! Looks good, just needs a few tweaks.

rohan-sinha’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Small changes

rohan-sinha’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Think that reads better.

  • catch committed 0b7d095e on 10.1.x
    Issue #3353693 by rckstr_rohan, joachim, smustgrave: the way...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0b7d095 and pushed to 10.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.