function _views_query::ensure_path in Views (for Drupal 7) 5
2 calls to _views_query::ensure_path()
File
- ./
views_query.inc, line 511
Class
Code
function ensure_path($table, $traced = array(), $add = array()) {
if ($table == $this->primary_table) {
return true;
}
$table_data = _views_get_tables();
$left_table = $table_data[$table]['join']['left']['table'];
// Does it end at our views_get_title table?
if ($left_table == $this->primary_table) {
// We are done! Add our tables and unwind.
foreach (array_reverse($add) as $table) {
$this
->queue_table($table);
}
return true;
}
// Have we been this way?
if (isset($traced[$left_table])) {
// we looped. Broked.
return false;
}
// Do we have to add this table?
if (!isset($this->tables[$left_table])) {
$add[] = $left_table;
}
// Keep looking.
$traced[$left_table] = 1;
return $this
->ensure_path($left_table, $traced, $add);
}