Generates the table name by considering table prefix.
If [[useTablePrefix]] is false, the table name will be returned without change.
@param string $tableName the table name (which may contain schema prefix)
@return string the generated table name
977552
public function generateTableName($tableName)
    {
        if (!$this->useTablePrefix) {
            return $tableName;
        }

        $db = $this->getDbConnection();
        if (preg_match("/^{$db->tablePrefix}(.*?)$/", $tableName, $matches)) {
            $tableName = '{{%' . $matches[1] . '}}';
        } elseif (preg_match("/^(.*?){$db->tablePrefix}$/", $tableName, $matches)) {
            $tableName = '{{' . $matches[1] . '%}}';
        }
        return $tableName;
    }
1081828
public function generateUniqueAliasFor(string $tableName) : string
    {
        $aliases = array_flip($this->getTakenAliases());
        if (!isset($aliases[$tableName])) {
            return $tableName;
        }

        $count = 1;
        do {
            $newTableName = $tableName . $count;
            $count++;
        } while (isset($aliases[$newTableName]));

        return $newTableName;
    }
211991
protected function generateClassName($tableName)
    {
        if (isset($this->_classNames[$tableName])) {
            return $this->_classNames[$tableName];
        }

        if (($pos = strrpos($tableName, '.')) !== false) {
            $tableName = substr($tableName, $pos + 1);
        }

        $db = $this->getDbConnection();
        $patterns = [];
        $patterns[] = "/^{$db->tablePrefix}(.*?)$/";
        $patterns[] = "/^(.*?){$db->tablePrefix}$/";
        if (strpos($this->tableName, '*') !== false) {
            $pattern = $this->tableName;
            if (($pos = strrpos($pattern, '.')) !== false) {
                $pattern = substr($pattern, $pos + 1);
            }
            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
        }
        $className = $tableName;
        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $tableName, $matches)) {
                $className = $matches[1];
                break;
            }
        }

        return $this->_classNames[$tableName] = Inflector::id2camel($className, '_');
    }
673550
private String generateTableName(String repository) {
        if (table_prefix == null) {
            return repository + "_" + table_suffix;
        }
        return table_prefix + "_" + repository + "_" + table_suffix;
    }
508086
public function getTableName($table) {
        if (preg_match('#^`?\{[^\}]+\}.*$#', $table)) {
            return $this->sanitize(str_replace(['{', '}'], [$this->tablePrefix, ''], $table));
        } else {
            return $this->sanitize($table);
        }
    }
480365
public function cuGetColNamesFromTable($tableName)
    {

        $sql        = 'DESCRIBE ' . $tableName;
        $result     = $this->query($sql);
        $field_name = [];
        $data_array = [];
        while ($data = $result->fetch_assoc()) {
            $data_array[] = $data;
        }

        foreach ($data_array as $val) {
            $field_name[] = $val['Field'];
        }

        return $field_name;
    }
1255910
private function showCreateTable($tableName)
	{
		$prefix = App::get('db')->getPrefix();

		$create = App::get('db')->getTableCreate($tableName);
		$create = $create[$tableName];
		$create = str_replace("CREATE TABLE `{$prefix}", 'CREATE TABLE `#__', $create);
		$create = str_replace("\n", "\n\t\t\t\t", $create);
		$create = preg_replace('/(AUTO_INCREMENT=)([0-9]*)/', '${1}0', $create);

		return $create;
	}
741997
public function setTableName($tableName) {
        $this->query = str_replace($this->tableName, $tableName, $this->query);
        $this->dummyQuery = str_replace($this->tableName, $tableName, $this->dummyQuery);
        $this->tableName = $tableName;
        return $this;
    }
366032
public function rename($tableNames = [])
    {
        $schema = '';

        $schema .= strtoupper(__FUNCTION__).' TABLE '.PHP_EOL;

        if (is_array($tableNames)) {
            $i = 0;

            $arrCount = count($tableNames);

            foreach ($tableNames as $key => $value) {
                $schema .= '`'.$key.'` TO `'.$value.'`';

                $comma = ($i < $arrCount - 1) ? ',' : '';
                $schema .= $comma.PHP_EOL;
                $i++;
            }
        } else {
            $schema .= '`'.$this->database.'.`'.$this->tableName.'` TO `'.$tableNames.'`'.PHP_EOL;
        }

        $this->schema = $schema;

        return $this;
    }
572116
public function setTableName($tableName)
    {
        if (trim($tableName) == '') {
            $tableName = null;
        }
        $this->tableName = $tableName;

        return $this;
    }
435282
public static function prettifyTableName($table, $prefix = '')
    {
        if ($prefix) {
            $table = self::removePrefix($table, $prefix);
        }

        return self::underscoresToCamelCase($table, true);
    }
1214195
public function getTableInfoStr($tableName)
    {
        $metadata = Factory::createSourceFromAdapter($this->db);
        $table = $metadata->getTable($tableName);
        $spaces = function ($count) {
            return str_repeat(' ', $count);
        };

        $result = "{$spaces(4)}With columns:" . PHP_EOL;

        /** @var ColumnObject $column */
        foreach ($table->getColumns() as $column) {
            $result .= "{$spaces(8)}{$column->getName()} -> {$column->getDataType()}" . PHP_EOL;
        }

        $result .= PHP_EOL;
        $result .= "{$spaces(4)}With constraints:" . PHP_EOL;

        /** @var ConstraintObject $constraint */
        foreach ($metadata->getConstraints($tableName) as $constraint) {
            $result .= "{$spaces(8)}{$constraint->getName()} -> {$constraint->getType()}" . PHP_EOL;

            if (!$constraint->hasColumns()) {
                continue;
            }

            $result .= "{$spaces(12)}column: " . implode(', ', $constraint->getColumns());

            if ($constraint->isForeignKey()) {
                $foreignKeyColumns = [];

                foreach ($constraint->getReferencedColumns() as $referenceColumn) {
                    $foreignKeyColumns[] = "{$constraint->getReferencedTableName()}.{$referenceColumn}";
                }

                $result .= ' => ' . implode(', ', $foreignKeyColumns) . PHP_EOL;
                $result .= "{$spaces(12)}OnDeleteRule: {$constraint->getDeleteRule()}" . PHP_EOL;
                $result .= "{$spaces(12)}OnUpdateRule: {$constraint->getUpdateRule()}" . PHP_EOL;
            } else {
                $result .= PHP_EOL;
            }
        }

        return $result;
    }
374012
public function prefixTable(string $table): string
	{
		// Add the prefix to the table name
		// before quoting it
		if ( ! empty($this->tablePrefix))
		{
			// Split identifier by period, will split into:
			// database.schema.table OR
			// schema.table OR
			// database.table OR
			// table
			$identifiers = explode('.', $table);
			$segments = count($identifiers);

			// Quote the last item, and add the database prefix
			$identifiers[$segments - 1] = $this->_prefix(end($identifiers));

			// Rejoin
			$table = implode('.', $identifiers);
		}

		return $table;
	}
1150821
protected function getTableName($entityName)
    {
        $tableName = $entityName;
        preg_match_all('/[A-Z][a-z]+/', $entityName, $matches);
        if (!empty($matches[0])) {
            $tableName = implode('_', $matches[0]);
        }
        return strtolower($tableName);
    }
382472
protected function getPrefixName($prefixName)
    {
        $prefixName = explode(':', $prefixName);
        $name = array_pop($prefixName);
        $prefix = array_pop($prefixName);
        return [$prefix, $name];
    }
231327
public function getTablePrefix()
    {
        if (isset($this->options['table_prefix'])) {
            $tablePrefix = $this->options['table_prefix'];
        } else {
        	$tablePrefix = $this->getDb()->getTablePrefix();
        }
        
        return $tablePrefix;
    }
116769
function ___table($tableName) {
        $this->name = $tableName;
        $this->table = $this->prefix.$tableName;
        return $this;
    }