PMA\libraries\DatabaseInterface::_cacheTableData PHP Méthode

_cacheTableData() private méthode

Caches table data so Table does not require to issue SHOW TABLE STATUS again
private _cacheTableData ( array $tables, string $table ) : void
$tables array information for tables of some databases
$table string table name
Résultat void
    private function _cacheTableData($tables, $table)
    {
        // Note: I don't see why we would need array_merge_recursive() here,
        // as it creates double entries for the same table (for example a double
        // entry for Comment when changing the storage engine in Operations)
        // Note 2: Instead of array_merge(), simply use the + operator because
        //  array_merge() renumbers numeric keys starting with 0, therefore
        //  we would lose a db name that consists only of numbers
        foreach ($tables as $one_database => $its_tables) {
            if (isset($this->_table_cache[$one_database])) {
                // the + operator does not do the intended effect
                // when the cache for one table already exists
                if ($table && isset($this->_table_cache[$one_database][$table])) {
                    unset($this->_table_cache[$one_database][$table]);
                }
                $this->_table_cache[$one_database] = $this->_table_cache[$one_database] + $tables[$one_database];
            } else {
                $this->_table_cache[$one_database] = $tables[$one_database];
            }
        }
    }