You are here

public static function QueryBase::getClass in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::getClass()
  2. 9 core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::getClass()

Finds a class in a list of namespaces.

Parameters

array $namespaces: A list of namespaces.

string $short_class_name: A class name without namespace.

Return value

string The fully qualified name of the class.

8 calls to QueryBase::getClass()
ConditionAggregate::compile in core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
PgsqlQueryFactory::get in core/modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php
Instantiates an entity query for a given entity type.
PgsqlQueryFactory::getAggregate in core/modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php
Instantiates an aggregation query object for a given entity type.
QueryBase::conditionGroupFactory in core/lib/Drupal/Core/Entity/Query/QueryBase.php
Creates an object holding a group of conditions.
QueryFactory::get in core/modules/workspaces/src/EntityQuery/QueryFactory.php
Instantiates an entity query for a given entity type.

... See full list

File

core/lib/Drupal/Core/Entity/Query/QueryBase.php, line 492

Class

QueryBase
The base entity query class.

Namespace

Drupal\Core\Entity\Query

Code

public static function getClass(array $namespaces, $short_class_name) {
  foreach ($namespaces as $namespace) {
    $class = $namespace . '\\' . $short_class_name;
    if (class_exists($class)) {
      return $class;
    }
  }
}