private function _getTableCondition($table, $tbl_is_group, $table_type)
{
// get table information from information_schema
if ($table) {
if (is_array($table)) {
$sql_where_table = 'AND t.`TABLE_NAME` ' . Util::getCollateForIS() . ' IN (\'' . implode('\', \'', array_map(array($this, 'escapeString'), $table)) . '\')';
} elseif (true === $tbl_is_group) {
$sql_where_table = 'AND t.`TABLE_NAME` LIKE \'' . Util::escapeMysqlWildcards($GLOBALS['dbi']->escapeString($table)) . '%\'';
} else {
$sql_where_table = 'AND t.`TABLE_NAME` ' . Util::getCollateForIS() . ' = \'' . $GLOBALS['dbi']->escapeString($table) . '\'';
}
} else {
$sql_where_table = '';
}
if ($table_type) {
if ($table_type == 'view') {
$sql_where_table .= " AND t.`TABLE_TYPE` != 'BASE TABLE'";
} else {
if ($table_type == 'table') {
$sql_where_table .= " AND t.`TABLE_TYPE` = 'BASE TABLE'";
}
}
}
return $sql_where_table;
}