Commit 78b53468 authored by Crell's avatar Crell
Browse files

Add more use statements and class renaming.

parent 00170776
<?php
use Drupal\Database\Query\Select;
/**
* @file
* Entity query API.
......@@ -935,7 +937,7 @@ function finishQuery($select_query, $id_key = 'entity_id') {
* HAVING or WHERE. This is necessary because SQL can't handle WHERE
* conditions on aliased columns.
*/
public function addCondition(SelectQuery $select_query, $sql_field, $condition, $having = FALSE) {
public function addCondition(Select $select_query, $sql_field, $condition, $having = FALSE) {
$method = $having ? 'havingCondition' : 'condition';
$like_prefix = '';
switch ($condition['operator']) {
......
<?php
use Drupal\Database\Database;
use Drupal\Database\Query\Select;
/**
* @file
......@@ -594,7 +595,7 @@ function field_sql_storage_field_storage_query(EntityFieldQuery $query) {
* @return
* The name of the entity base table joined in.
*/
function _field_sql_storage_query_join_entity(SelectQuery $select_query, $entity_type, $field_base_table) {
function _field_sql_storage_query_join_entity(Select $select_query, $entity_type, $field_base_table) {
$entity_info = entity_get_info($entity_type);
$entity_base_table = $entity_info['base table'];
$entity_field = $entity_info['entity keys']['id'];
......@@ -617,7 +618,7 @@ function _field_sql_storage_query_join_entity(SelectQuery $select_query, $entity
* A callback that should return the column name to be used for the field
* conditions. Accepts a field name and a field column name as parameters.
*/
function _field_sql_storage_query_field_conditions(EntityFieldQuery $query, SelectQuery $select_query, $conditions, $table_aliases, $column_callback) {
function _field_sql_storage_query_field_conditions(EntityFieldQuery $query, Select $select_query, $conditions, $table_aliases, $column_callback) {
$groups = &drupal_static(__FUNCTION__, array());
foreach ($conditions as $key => $condition) {
$table_alias = $table_aliases[$key];
......
<?php
use Drupal\Database\Query\SelectInterface;
/**
* @file
* Content administration and module settings UI.
......@@ -123,7 +125,7 @@ function node_filters() {
* @param $query
* A SelectQuery to which the filters should be applied.
*/
function node_build_filter_query(SelectQueryInterface $query) {
function node_build_filter_query(SelectInterface $query) {
// Build query
$filter_data = isset($_SESSION['node_overview_filter']) ? $_SESSION['node_overview_filter'] : array();
foreach ($filter_data as $index => $filter) {
......
<?php
use Drupal\Database\Query\AlterableInterface;
use Drupal\Database\Query\SelectExtender;
use Drupal\Database\Query\SelectInterface;
/**
* @file
......@@ -1617,7 +1619,7 @@ function node_permission() {
* @param $query
* A query object that has been extended with the Search DB Extender.
*/
function _node_rankings(SelectQueryExtender $query) {
function _node_rankings(SelectExtender $query) {
if ($ranking = module_invoke_all('ranking')) {
$tables = &$query->getTables();
foreach ($ranking as $rank => $values) {
......@@ -3318,7 +3320,7 @@ function _node_query_node_access_alter($query, $type) {
if (!$base_table) {
$fallback = '';
foreach ($tables as $alias => $table_info) {
if (!($table_info instanceof SelectQueryInterface)) {
if (!($table_info instanceof SelectInterface)) {
$table = $table_info['table'];
// If the node table is in the query, it wins immediately.
if ($table == 'node') {
......@@ -3390,7 +3392,7 @@ function _node_query_node_access_alter($query, $type) {
}
foreach ($tables as $nalias => $tableinfo) {
$table = $tableinfo['table'];
if (!($table instanceof SelectQueryInterface) && $table == $base_table) {
if (!($table instanceof SelectInterface) && $table == $base_table) {
// The node_access table has the access grants for any given node so JOIN
// it to the table containing the nid which can be either the node
......
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