function Sql::mark_table

1 call to Sql::mark_table()
Sql::queue_table in drupal/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
Add a table to the query without ensuring the path.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php, line 466
Definition of Drupal\views\Plugin\views\query\Sql.

Class

Sql
@todo.

Namespace

Drupal\views\Plugin\views\query

Code

function mark_table($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] = array(
      'count' => 1,
      'alias' => $alias,
    );
  }
  else {
    $this->tables[$relationship][$table]['count']++;
  }
  return $alias;
}