PMA\libraries\Util::processIndexData PHP Method

processIndexData() public static method

Process the index data.
public static processIndexData ( array $indexes ) : array
$indexes array index data
return array processes index data
    public static function processIndexData($indexes)
    {
        $lastIndex = '';
        $primary = '';
        $pk_array = array();
        // will be use to emphasis prim. keys in the table
        $indexes_info = array();
        $indexes_data = array();
        // view
        foreach ($indexes as $row) {
            // Backups the list of primary keys
            if ($row['Key_name'] == 'PRIMARY') {
                $primary .= $row['Column_name'] . ', ';
                $pk_array[$row['Column_name']] = 1;
            }
            // Retains keys informations
            if ($row['Key_name'] != $lastIndex) {
                $indexes[] = $row['Key_name'];
                $lastIndex = $row['Key_name'];
            }
            $indexes_info[$row['Key_name']]['Sequences'][] = $row['Seq_in_index'];
            $indexes_info[$row['Key_name']]['Non_unique'] = $row['Non_unique'];
            if (isset($row['Cardinality'])) {
                $indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality'];
            }
            // I don't know what does following column mean....
            // $indexes_info[$row['Key_name']]['Packed']          = $row['Packed'];
            $indexes_info[$row['Key_name']]['Comment'] = $row['Comment'];
            $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name'] = $row['Column_name'];
            if (isset($row['Sub_part'])) {
                $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Sub_part'] = $row['Sub_part'];
            }
        }
        // end while
        return array($primary, $pk_array, $indexes_info, $indexes_data);
    }
Util