@param $table

@return string
351824
public function get_table( $table ) {
		if (
			! isset( $this->table_defines[ $table ] ) ||
			! empty( $this->table_defines[ $table ]['wordpress'] ) ||
			! empty( $this->table_defines[ $table ]['global'] )
		) {
			return $table;
		}

		return $this->get_table_prefix() . $table;
	}
350994
public function get_columns($table) {
		$result = $this->get_table_definition($table);

		$columns = [];
		foreach ($result as $row) {
			$columns[] = &$row['Field'];
		}

		return $columns;
	}
910922
public function getCreateTableSql($table)
    {
        $table = $this->buildRealTableName($table);
        return $this->getSchema()->getCreateTableSql($table);
    }
117465
public function describeTable($table)
    {
        $table = explode('.', $table);
        if (count($table) > 1) {
            $schema = $table[0];
            $table = $table[1];
        } else {
            $schema = $this->getDefaultSchema();
            $table = $table[0];
        }

        return $this->getDescriptor()->describeTables($schema, [$table], true);
    }
386312
public function getTableIndexes( $table )
    {
        $query = "SELECT * FROM information_schema.statistics WHERE table_schema =
                 ? AND table_name = ?";

        $params = [ $this->name, $table ];

        $statement = $this->database->prepare( $query );
        $statement->execute( $params );

        $results = $statement->fetchAll();

        $indexes = [ ];

        if ( !empty( $results ) )
        {
            $name = NULL;

            $i = 0;

            foreach ( $results as $result )
            {
                if ( !in_array( $result[ 'INDEX_NAME' ], $indexes ) )
                {
                    $indexes[ ] = $result[ 'INDEX_NAME' ];
                }
            }
        }

        return $indexes;
    }
531301
public function getTableDefinition($table)
    {
        foreach ($this->getTableDefinitions() as $definition) {
            if ($definition->getName() === $table) {
                return $definition;
            }
        }

        return null;
    }
150012
public function getPrimaryKey($table){
		$key = '';
		$pos = strpos($table, '.');
		if($pos !== false)
			$table = substr($table, $pos + 1);
		if(isset($this->tblData[$table]))
			$sql = $this->tblData[$table];
		else{
			$q = $this->runQuery("SELECT sql FROM sqlite_master WHERE tbl_name='$table'");
			$r = $this->fetch($q);
			if($r === false)
				return '';
			$this->tblData[$table] = $sql = $r['sql'];
		}

		$sql = explode("\n", $sql);
		foreach($sql as $field){
			$field = trim($field);
			if(stripos($field, 'PRIMARY KEY') !== false && $key === '')
				$key = preg_replace('~^"(\w+)".*$~i', '$1', $field);
		}
		return $key;
	}
378965
public function prepareTableExample($table)
    {
        $tableExample = '';
        $definitions = $this->calibrateDefinitions($table);

        foreach ($definitions as $key => $column) {
            $columnDefinition = explode(':', $column);
            $example = $this->createExampleByType($columnDefinition[1]);

            if ($key === 0) {
                $tableExample .= "'$columnDefinition[0]' => '$example',\n";
            } else {
                $tableExample .= "\t\t'$columnDefinition[0]' => '$example',\n";
            }
        }

        return $tableExample;
    }
252197
public function getTable($table)
    {
        return array_merge(
            $this->cache['tables'][$table],
            [
                'fields'      => $this->cache['fields'][$table] ?? [],
                'constraints' => $this->cache['constraints'][$table] ?? [],
            ]
        );
    }
35050
public function getTableColumns($table)
    {
        $driver = $this->getDriverName();
        $bind = [];
        if ($driver == 'sqlite') {
            $table = $this->quoteIdentifiers($table);
            $sql = 'PRAGMA table_info(' . $table . ');';
            $key = 'name';
        } elseif ($driver == 'mysql') {
            $table = $this->quoteIdentifiers($table);
            $sql = 'DESCRIBE ' . $table . ';';
            $key = 'Field';
        } else {
            $bind[] = $table;
            $sql = 'SELECT column_name FROM information_schema.columns WHERE ';
            if($driver == 'pgsql'){
                $bind = explode('.', $table, 2);
                if(count($bind) == 2){
                    $sql.='table_schema = ? AND ';
                }
            }
            $sql.='table_name = ? ;';
            $key = 'column_name';
        }

        $fields = [];
        if (is_array($list = $this->run($sql, $bind, false))) {
            foreach ($list as $record) {
                $fields[] = $record[$key];
            }
            return $fields;
        }
        return $fields;
    }
925306
public function getIdActionColumnNames($table)
    {
        $columns = $this->getColumns($table);

        $columns = array_filter($columns, function ($columnName) {
            return strpos($columnName, 'idaction') !== false;
        });

        return array_values($columns);
    }
708780
public function getPrimaryKey($table)
    {
        if (! $table) {
            return '';
        }

        $sql = "SELECT cols.column_name
            FROM all_constraints cons, all_cons_columns cols
            WHERE upper(cols.table_name) = upper('{$table}')
                AND cons.constraint_type = 'P'
                AND cons.constraint_name = cols.constraint_name
                AND cons.owner = cols.owner
                AND cols.position = 1
                AND cons.owner = (select user from dual)
            ORDER BY cols.table_name, cols.position";
        $data = $this->connection->selectOne($sql);

        if ($data) {
            return $data->column_name;
        }

        return '';
    }
228401
public function prepareTableDefinition($table)
    {
        $tableDefintion = '';
        $definitions = $this->calibrateDefinitions($table);

        foreach ($definitions as $column) {
            $columnDefinition = explode(':', $column);
            $tableDefintion .= "\t\t'$columnDefinition[0]',\n";
        }

        return $tableDefintion;
    }
475386
public function tableClass($table)
    {
        $tables = $this->getTableNames();
        $class = array_search($table, $tables, true);
        if ($class) {
            return $class;
        }

        // If there is no class for this table, strip table modifiers (e.g. _Live / _Versions)
        // from the end and re-attempt a search.
        if (preg_match('/^(?<class>.+)(_[^_]+)$/i', $table, $matches)) {
            $table = $matches['class'];
            $class = array_search($table, $tables, true);
            if ($class) {
                return $class;
            }
        }
        return null;
    }
336061
public function getCacheVer($table)
    {
        if (!$this->openCache) {
            return '';
        }

        $version = Model::getInstance()->cache()->get($this->conf['mark'] . '_db_cache_version_' . $table);
        if (!$version) {
            $version = microtime(true);
            Model::getInstance()->cache()->set($this->conf['mark'] . '_db_cache_version_' . $table, $version, $this->conf['cache_expire']);
        }
        return $version;
    }
640220
public function tableName($table=null)
	{
		if(null === $table)
		{
			return $this->prefix . $this->table;
		}
		else
		{
			return $this->prefix . $table;
		}
	}
1201980
public function getCreateTable(string $table): string
	{
		return (string) $this->context->query('SHOW CREATE TABLE ' . $table)->fetch()->{'Create Table'};
	}