src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/unique_index_name.php
static public function validate( ezcDbSchema $schema )
    {
        $indexes = array();
        $errors = array();

        /* For each table we check all auto increment fields. */
        foreach ( $schema->getSchema() as $tableName => $table )
        {
            foreach ( $table->indexes as $indexName => $dummy )
            {
                $indexes[$indexName][] = $tableName;
            }
        }

        foreach ( $indexes as $indexName => $tableList )
        {
            if ( count( $tableList ) > 1 )
            {
                $errors[] = "The index name '$indexName' is not unique. It exists for the tables: '" . join( "', '", $tableList ) . "'.";
            }
        }

        return $errors;
    }
static public function validate( ezcDbSchema $schema )
    {
        $indexes = array();
        $errors = array();

        /* For each table we check all auto increment fields. */
        foreach ( $schema->getSchema() as $tableName => $table )
        {
            foreach ( $table->indexes as $indexName => $dummy )
            {
                $indexes[$indexName][] = $tableName;
            }
        }

        foreach ( $indexes as $indexName => $tableList )
        {
            if ( count( $tableList ) > 1 )
            {
                $errors[] = "The index name '$indexName' is not unique. It exists for the tables: '" . join( "', '", $tableList ) . "'.";
            }
        }

        return $errors;
    }
static public function validate ( ezcDbSchema $ schema ) { $ indexes = array ( ) ; $ errors = array ( ) ; /* For each table we check all auto increment fields. */ foreach ( $ schema -> getSchema ( ) as $ tableName => $ table ) { foreach ( $ table -> indexes as $ indexName => $ dummy ) { $ indexes [ $ indexName ] [ ] = $ tableName ; } } foreach ( $ indexes as $ indexName => $ tableList ) { if ( count ( $ tableList ) > 1 ) { $ errors [ ] = "The index name '$indexName' is not unique. It exists for the tables: '" . join ( "', '" , $ tableList ) . "'." ; } } return $ errors ; }
Validates if all the index names used are unique accross the schema.

This method loops over all the indexes in all tables and checks whether
they have been used before.

@param ezcDbSchema $schema
@return array(string)
Validates if all the index names used are unique accross the schema .