Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Sql.php

function Sql::markTable

1 call to Sql::markTable()
Sql::queueTable in core/modules/views/src/Plugin/views/query/Sql.php
Add a table to the query without ensuring the path.

File

core/modules/views/src/Plugin/views/query/Sql.php, line 576

Class

Sql
Views query plugin for an SQL query.

Namespace

Drupal\views\Plugin\views\query

Code

protected function markTable($table, $relationship, $alias) {
    // Mark that this table has been added.
    if (empty($this->tables[$relationship][$table])) {
        if (!isset($alias)) {
            $alias = '';
            if ($relationship != $this->view->storage
                ->get('base_table')) {
                // Double underscore will help prevent accidental name
                // space collisions.
                $alias = $relationship . '__';
            }
            $alias .= $table;
        }
        $this->tables[$relationship][$table] = [
            'count' => 1,
            'alias' => $alias,
        ];
    }
    else {
        $this->tables[$relationship][$table]['count']++;
    }
    return $alias;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal