diff -u b/core/lib/Drupal/Core/Entity/Query/QueryBase.php b/core/lib/Drupal/Core/Entity/Query/QueryBase.php --- b/core/lib/Drupal/Core/Entity/Query/QueryBase.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryBase.php @@ -175,17 +175,15 @@ * * See andConditionGroup() and orConditionGroup() for more. * - * @param $conjunction + * @param string $conjunction * - AND (default): this is the equivalent of andConditionGroup(). * - OR: this is the equivalent of orConditionGroup(). * - * return \Drupal\Core\Entity\Query\ConditionInterface + * @return \Drupal\Core\Entity\Query\ConditionInterface * An object holding a group of conditions. */ protected function conditionGroupFactory($conjunction = 'AND') { - preg_match('/^.*\\\\/', get_class($this), $matches); - $class = $matches[0] .'Condition'; - return new $class($conjunction, $this); + return new namespace\Condition($conjunction, $this); } /** diff -u b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php --- b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php @@ -15,6 +15,8 @@ class Condition extends ConditionBase { /** + * The SQL entity query object this condition belongs to. + * * @var \Drupal\Core\Entity\Query\Sql\Query */ protected $query; diff -u b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php --- b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php @@ -317,12 +317,13 @@ /** * Gets the Tables object for this query. * + * @param \Drupal\Core\Database\Query\SelectInterface $sql_query + * The SQL query object being built. + * * @return \Drupal\Core\Entity\Query\Sql\TablesInterface */ public function getTables(SelectInterface $sql_query) { - preg_match('/^.*\\\\/', get_class($this), $matches); - $class = $matches[0] .'Tables'; - return new $class($sql_query); + return new namespace\Tables($sql_query); } } diff -u b/core/lib/Drupal/Core/Entity/Query/Sql/QueryFactory.php b/core/lib/Drupal/Core/Entity/Query/Sql/QueryFactory.php --- b/core/lib/Drupal/Core/Entity/Query/Sql/QueryFactory.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/QueryFactory.php @@ -49,9 +49,7 @@ * The factored query. */ public function get($entity_type, $conjunction, EntityManager $entity_manager) { - preg_match('/^.*\\\\/', get_class($this), $matches); - $class = $matches[0] .'Query'; - return new $class($entity_type, $entity_manager, $conjunction, $this->connection); + return new namespace\Query($entity_type, $entity_manager, $conjunction, $this->connection); } /** @@ -67,9 +65,7 @@ * The factored aggregation query. */ public function getAggregate($entity_type, $conjunction, EntityManager $entity_manager) { - preg_match('/^.*\\\\/', get_class($this), $matches); - $class = $matches[0] .'QueryAggregate'; - return new $class($entity_type, $entity_manager, $conjunction, $this->connection); + return new namespace\QueryAggregate($entity_type, $entity_manager, $conjunction, $this->connection); } } diff -u b/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php b/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php --- b/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php @@ -5,14 +5,13 @@ * Contains \Drupal\Core\Entity\Query\Sql\TablesInterface. */ - namespace Drupal\Core\Entity\Query\Sql; - /** * Adds tables and fields to the SQL entity query. */ interface TablesInterface { + /** * @param string $field * If it contains a dot, then field name dot field column. If it doesn't @@ -28,2 +27,3 @@ public function addField($field, $type, $langcode); + }