Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b537ccd5
Commit
b537ccd5
authored
Jun 26, 2013
by
alexpott
Browse files
Issue
#2028489
by chx, dawehner: Move entity query out of field_sql_storage().
parent
272c5c6b
Changes
9
Hide whitespace changes
Inline
Side-by-side
core/core.services.yml
View file @
b537ccd5
...
...
@@ -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'
]
...
...
core/lib/Drupal/Core/Entity/DatabaseStorageController.php
View file @
b537ccd5
...
...
@@ -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
'
;
}
}
core/
modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity
/Condition.php
→
core/
lib/Drupal/Core/Entity/Query/Sql
/Condition.php
View file @
b537ccd5
...
...
@@ -2,10 +2,10 @@
/**
* @file
*
Definition of Drupal\field_sql_storage
\Query\Condition
Sql
.
*
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
;
...
...
core/
modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity
/ConditionAggregate.php
→
core/
lib/Drupal/Core/Entity/Query/Sql
/ConditionAggregate.php
View file @
b537ccd5
...
...
@@ -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
;
...
...
core/
modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity
/Query.php
→
core/
lib/Drupal/Core/Entity/Query/Sql
/Query.php
View file @
b537ccd5
...
...
@@ -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_storag
e\Entity\Query
* @return \Drupal\
Cor
e\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_storag
e\Entity\Query
* @return \Drupal\
Cor
e\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_storag
e\Entity\Query
* @return \Drupal\
Cor
e\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_storag
e\Entity\Query
* @return \Drupal\
Cor
e\Entity\Query
\Sql\Query
* Returns the called object.
*/
protected
function
finish
()
{
...
...
core/
modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity
/QueryAggregate.php
→
core/
lib/Drupal/Core/Entity/Query/Sql
/QueryAggregate.php
View file @
b537ccd5
...
...
@@ -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.
...
...
core/
modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity
/QueryFactory.php
→
core/
lib/Drupal/Core/Entity/Query/Sql
/QueryFactory.php
View file @
b537ccd5
...
...
@@ -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_storag
e\Entity\Query
* @see \Drupal\
field_sql_storage\Entity
\QueryAggregate
* @see \Drupal\
Cor
e\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_storag
e\Entity\Query
* @return \Drupal\
Cor
e\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
)
{
...
...
core/
modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity
/Tables.php
→
core/
lib/Drupal/Core/Entity/Query/Sql
/Tables.php
View file @
b537ccd5
...
...
@@ -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
;
...
...
core/modules/field_sql_storage/field_sql_storage.services.yml
deleted
100644 → 0
View file @
272c5c6b
services
:
entity.query.field_sql_storage
:
class
:
Drupal\field_sql_storage\Entity\QueryFactory
arguments
:
[
'
@database'
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment