You are here

function _views_query::add_table in Views (for Drupal 7) 5

File

./views_query.inc, line 462

Class

_views_query

Code

function add_table($table, $ensure_path = false, $howmany = 1, $joininfo = NULL) {
  if ($table == $this->primary_table) {
    return;
  }
  if ($ensure_path && !$this
    ->ensure_path($table)) {
    return false;
  }
  $this->tables[$table] += $howmany;
  for ($i = $this->tables[$table] - $howmany + 1; $i <= $this->tables[$table]; $i++) {
    if ($joininfo) {
      $this->joins[$table][$i] = $joininfo;
    }
    $this->tablequeue[] = array(
      'table' => $table,
      'num' => $i,
      'alias_prefix' => $this->use_alias_prefix,
    );
  }
  return $this->tables[$table];
}