unset($fields[$field_name]);
} } // Make every alias in the subquery safe within the outer query by
// appending a namespace to it, '_inner' by default.
$tables = &
$subquery->
getTables();
foreach (array_keys($tables) as $table_name) { $tables[$table_name]['alias'
] .=
$this->subquery_namespace;
// Namespace the join on every table.
if (isset($tables[$table_name]['condition'
])) { $tables[$table_name]['condition'
] =
$this->
conditionNamespace($tables[$table_name]['condition'
]);
} } // Namespace fields.
foreach (array_keys($fields) as $field_name) { $fields[$field_name]['table'
] .=
$this->subquery_namespace;
$fields[$field_name]['alias'
] .=
$this->subquery_namespace;
} // Namespace conditions.
$where = &
$subquery->
conditions();
$this->
alterSubqueryCondition($subquery,
$where);
// Not sure why, but our sort order clause doesn't have a table.