src/MVQN/Data/Models/Model.php
private static function getColumns(string $table): array
    {
        if (self::$columnsCache !== null && array_key_exists($table, self::$columnsCache))
            return self::$columnsCache[$table];

        // Ensure the database is connected!
        $pdo = Database::connect();

        /** @noinspection SqlResolve */
        $query = "
            SELECT
                *
            FROM 
                information_schema.columns
            WHERE table_name = '$table'
        ";

        self::$columnsCache[$table] = [];

        $rows = $pdo->query($query);
        while($row = $rows->fetch())
            self::$columnsCache[$table][$row["column_name"]] = $row;

        return self::$columnsCache[$table];
    }
private static function getColumns(string $table): array
    {
        if (self::$columnsCache !== null && array_key_exists($table, self::$columnsCache))
            return self::$columnsCache[$table];

        // Ensure the database is connected!
        $pdo = Database::connect();

        /** @noinspection SqlResolve */
        $query = "
            SELECT
                *
            FROM 
                information_schema.columns
            WHERE table_name = '$table'
        ";

        self::$columnsCache[$table] = [];

        $rows = $pdo->query($query);
        while($row = $rows->fetch())
            self::$columnsCache[$table][$row["column_name"]] = $row;

        return self::$columnsCache[$table];
    }
Gets all of the columns from the specified table schema.

@param string $table The name of the table for which to inspect.
@return array Returns an associative array of column name => column schema data.
@throws DatabaseConnectionException