protected function buildIndexName(string $tableName, array $indexDef): string {
        $indexDef += ['type' => Db::INDEX_IX, 'suffix' => ''];

        $type = $indexDef['type'];

        if ($type === Db::INDEX_PK) {
            return 'primary';
        }
        $px = self::val($type, [Db::INDEX_IX => 'ix_', Db::INDEX_UNIQUE => 'ux_'], 'ix_');
        $sx = $indexDef['suffix'];
        $result = $px.$tableName.'_'.($sx ?: implode('', $indexDef['columns']));
        return $result;
    }
protected function buildIndexName(string $tableName, array $indexDef): string {
        $indexDef += ['type' => Db::INDEX_IX, 'suffix' => ''];

        $type = $indexDef['type'];

        if ($type === Db::INDEX_PK) {
            return 'primary';
        }
        $px = self::val($type, [Db::INDEX_IX => 'ix_', Db::INDEX_UNIQUE => 'ux_'], 'ix_');
        $sx = $indexDef['suffix'];
        $result = $px.$tableName.'_'.($sx ?: implode('', $indexDef['columns']));
        return $result;
    }
protected function buildIndexName ( string $ tableName , array $ indexDef ) : string { $ indexDef += [ 'type' => Db :: INDEX_IX , 'suffix' => '' ] ; $ type = $ indexDef [ 'type' ] ; if ( $ type === Db :: INDEX_PK ) { return 'primary' ; } $ px = self :: val ( $ type , [ Db :: INDEX_IX => 'ix_' , Db :: INDEX_UNIQUE => 'ux_' ] , 'ix_' ) ; $ sx = $ indexDef [ 'suffix' ] ; $ result = $ px . $ tableName . '_' . ( $ sx ? : implode ( '' , $ indexDef [ 'columns' ] ) ) ; return $ result ; }
Build a standardized index name from an index definition.

@param string $tableName The name of the table the index is in.
@param array $indexDef The index definition.
@return string Returns the index name.
Build a standardized index name from an index definition .