PMA\libraries\DatabaseInterface::_getTableCondition PHP Method

_getTableCondition() private method

returns a segment of the SQL WHERE clause regarding table name and type
private _getTableCondition ( array | string $table, boolean $tbl_is_group, string $table_type ) : string
$table array | string table(s)
$tbl_is_group boolean $table is a table group
$table_type string whether table or view
return string a segment of the WHERE clause
    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;
    }