public function formatTable($table, $alias = null) {
        if (!$table) {
            throw new InvalidTableException('Missing table name for query');
        }

        $output = $this->quote($table);

        if ($alias && $table !== $alias) {
            $output = sprintf($this->getClause(self::AS_ALIAS), $output, $this->quote($alias));
        }

        return $output;
    }