private function _getWhereClauseTablesAndColumns()
{
$where_clause_columns = array();
$where_clause_tables = array();
// Now we need all tables that we have in the where clause
for ($column_index = 0, $nb = count($this->_criteria); $column_index < $nb; $column_index++) {
$current_table = explode('.', $_POST['criteriaColumn'][$column_index]);
if (empty($current_table[0]) || empty($current_table[1])) {
continue;
}
// end if
$table = str_replace('`', '', $current_table[0]);
$column = str_replace('`', '', $current_table[1]);
$column = $table . '.' . $column;
// Now we know that our array has the same numbers as $criteria
// we can check which of our columns has a where clause
if (!empty($this->_criteria[$column_index])) {
if (mb_substr($this->_criteria[$column_index], 0, 1) == '=' || stristr($this->_criteria[$column_index], 'is')) {
$where_clause_columns[$column] = $column;
$where_clause_tables[$table] = $table;
}
}
// end if
}
// end for
return array('where_clause_tables' => $where_clause_tables, 'where_clause_columns' => $where_clause_columns);
}