You are here

function views_query::mark_table in Views (for Drupal 7) 6.2

1 call to views_query::mark_table()
views_query::queue_table in includes/query.inc
Add a table to the query without ensuring the path.

File

includes/query.inc, line 352
query.inc Defines the query object which is the underlying layer in a View.

Class

views_query
Object used to create a SELECT 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->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;
}