Commit b537ccd5 authored by alexpott's avatar alexpott

Issue #2028489 by chx, dawehner: Move entity query out of field_sql_storage().

parent 272c5c6b
......@@ -253,6 +253,9 @@ services:
entity.query.config:
class: Drupal\Core\Config\Entity\Query\QueryFactory
arguments: ['@config.storage']
entity.query.sql:
class: Drupal\Core\Entity\Query\Sql\QueryFactory
arguments: ['@database']
router.dumper:
class: Drupal\Core\Routing\MatcherDumper
arguments: ['@database']
......
......@@ -556,6 +556,6 @@ public function baseFieldDefinitions() {
* Implements \Drupal\Core\Entity\EntityStorageControllerInterface::getQueryServiceName().
*/
public function getQueryServiceName() {
return 'entity.query.field_sql_storage';
return 'entity.query.sql';
}
}
......@@ -2,10 +2,10 @@
/**
* @file
* Definition of Drupal\field_sql_storage\Query\ConditionSql.
* Contains \Drupal\Core\Entity\Query\Sql\Condition.
*/
namespace Drupal\field_sql_storage\Entity;
namespace Drupal\Core\Entity\Query\Sql;
use Drupal\Core\Entity\Query\ConditionBase;
use Drupal\Core\Entity\Query\ConditionInterface;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field_sql_storage\Query\ConditionAggregate.
* Contains \Drupal\Core\Entity\Query\Sql\ConditionAggregate.
*/
namespace Drupal\field_sql_storage\Entity;
namespace Drupal\Core\Entity\Query\Sql;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Entity\Query\ConditionAggregateBase;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Definition of Drupal\field_sql_storage\Entity\Query.
* Contains \Drupal\Core\Entity\Query\Sql\Query.
*/
namespace Drupal\field_sql_storage\Entity;
namespace Drupal\Core\Entity\Query\Sql;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityManager;
......@@ -111,7 +111,7 @@ public function execute() {
* @throws \Drupal\Core\Entity\Query\QueryException
* Thrown if the base table does not exists.
*
* @return \Drupal\field_sql_storage\Entity\Query
* @return \Drupal\Core\Entity\Query\Sql\Query
* Returns the called object.
*/
protected function prepare() {
......@@ -173,7 +173,7 @@ protected function prepare() {
/**
* Compiles the conditions.
*
* @return \Drupal\field_sql_storage\Entity\Query
* @return \Drupal\Core\Entity\Query\Sql\Query
* Returns the called object.
*/
protected function compile() {
......@@ -184,7 +184,7 @@ protected function compile() {
/**
* Adds the sort to the build query.
*
* @return \Drupal\field_sql_storage\Entity\Query
* @return \Drupal\Core\Entity\Query\Sql\Query
* Returns the called object.
*/
protected function addSort() {
......@@ -242,7 +242,7 @@ protected function addSort() {
/**
* Finish the query by adding fields, GROUP BY and range.
*
* @return \Drupal\field_sql_storage\Entity\Query
* @return \Drupal\Core\Entity\Query\Sql\Query
* Returns the called object.
*/
protected function finish() {
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field_sql_storage\Entity\QueryAggregate.
* Contains \Drupal\Core\Entity\Query\Sql\QueryAggregate.
*/
namespace Drupal\field_sql_storage\Entity;
namespace Drupal\Core\Entity\Query\Sql;
use Drupal\Core\Entity\Query\QueryAggregateInterface;
......@@ -39,7 +39,7 @@ public function execute() {
}
/**
* Overrides \Drupal\field_sql_storage\Entity::prepare().
* Overrides \Drupal\Core\Entity\Query\Sql::prepare().
*/
public function prepare() {
parent::prepare();
......@@ -73,7 +73,7 @@ public function notExistsAggregate($field, $function, $langcode = NULL) {
/**
* Adds the aggregations to the query.
*
* @return \Drupal\field_sql_storage\Entity\QueryAggregate
* @return \Drupal\Core\Entity\Query\Sql\QueryAggregate
* Returns the called object.
*/
protected function addAggregate() {
......@@ -89,7 +89,7 @@ protected function addAggregate() {
/**
* Builds the aggregation conditions part of the query.
*
* @return \Drupal\field_sql_storage\Entity\QueryAggregate
* @return \Drupal\Core\Entity\Query\Sql\QueryAggregate
* Returns the called object.
*/
protected function compileAggregate() {
......@@ -100,7 +100,7 @@ protected function compileAggregate() {
/**
* Adds the groupby values to the actual query.
*
* @return \Drupal\field_sql_storage\Entity\QueryAggregate
* @return \Drupal\Core\Entity\Query\Sql\QueryAggregate
* Returns the called object.
*/
protected function addGroupBy() {
......@@ -118,7 +118,7 @@ protected function addGroupBy() {
/**
* Builds the aggregation sort part of the query.
*
* @return \Drupal\field_sql_storage\Entity\QueryAggregate
* @return \Drupal\Core\Entity\Query\Sql\QueryAggregate
* Returns the called object.
*/
protected function addSortAggregate() {
......@@ -132,7 +132,7 @@ protected function addSortAggregate() {
/**
* Overrides \Drupal\field_sql_storage\Entity\Query::finish().
* Overrides \Drupal\Core\Entity\Query\Sql\Query::finish().
*
* Adds the sql expressions to the query.
*/
......@@ -165,7 +165,7 @@ function createSqlAlias($field, $sql_field) {
}
/**
* Overrides \Drupal\field_sql_storage\Entity\Query::result().
* Overrides \Drupal\Core\Entity\Query\Sql\Query::result().
*
* @return array|int
* Returns the aggregated result, or a number if it's a count query.
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field_sql_storage\Entity\QueryFactory.
* Contains \Drupal\Core\Entity\Query\Sql\QueryFactory.
*/
namespace Drupal\field_sql_storage\Entity;
namespace Drupal\Core\Entity\Query\Sql;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityManager;
......@@ -14,8 +14,8 @@
/**
* Factory class creating entity query objects for the SQL backend.
*
* @see \Drupal\field_sql_storage\Entity\Query
* @see \Drupal\field_sql_storage\Entity\QueryAggregate
* @see \Drupal\Core\Entity\Query\Sql\Query
* @see \Drupal\Core\Entity\Query\Sql\QueryAggregate
*/
class QueryFactory implements QueryFactoryInterface {
......@@ -45,7 +45,7 @@ function __construct(Connection $connection) {
* - AND: all of the conditions on the query need to match.
* - OR: at least one of the conditions on the query need to match.
*
* @return \Drupal\field_sql_storage\Entity\Query
* @return \Drupal\Core\Entity\Query\Sql\Query
* The factored query.
*/
function get($entity_type, $conjunction, EntityManager $entity_manager) {
......@@ -61,7 +61,7 @@ function get($entity_type, $conjunction, EntityManager $entity_manager) {
* - AND: all of the conditions on the query need to match.
* - OR: at least one of the conditions on the query need to match.
*
* @return \Drupal\field_sql_storage\Entity\QueryAggregate
* @return \Drupal\Core\Entity\Query\Sql\QueryAggregate
* The factored aggregation query.
*/
function getAggregate($entity_type, $conjunction, EntityManager $entity_manager) {
......
......@@ -2,10 +2,10 @@
/**
* @file
* Definition of Drupal\field_sql_storage\Entity\Tables.
* Contains \Drupal\Core\Entity\Query\Sql\Tables.
*/
namespace Drupal\field_sql_storage\Entity;
namespace Drupal\Core\Entity\Query\Sql;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Entity\Query\QueryException;
......
services:
entity.query.field_sql_storage:
class: Drupal\field_sql_storage\Entity\QueryFactory
arguments: ['@database']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment