lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
public function getCreateIndexSQL(Index $index, $table)
    {
        if ($table instanceof Table) {
            $table = $table->getQuotedName($this);
        }
        $name    = $index->getQuotedName($this);
        $columns = $index->getColumns();

        if (count($columns) === 0) {
            throw new InvalidArgumentException("Incomplete definition. 'columns' required.");
        }

        if ($index->isPrimary()) {
            return $this->getCreatePrimaryKeySQL($index, $table);
        }

        $query  = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $table;
        $query .= ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index);

        return $query;
    }
public function getCreateIndexSQL(Index $index, $table)
    {
        if ($table instanceof Table) {
            $table = $table->getQuotedName($this);
        }
        $name    = $index->getQuotedName($this);
        $columns = $index->getColumns();

        if (count($columns) === 0) {
            throw new InvalidArgumentException("Incomplete definition. 'columns' required.");
        }

        if ($index->isPrimary()) {
            return $this->getCreatePrimaryKeySQL($index, $table);
        }

        $query  = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $table;
        $query .= ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index);

        return $query;
    }
public function getCreateIndexSQL ( Index $ index , $ table ) { if ( $ table instanceof Table ) { $ table = $ table -> getQuotedName ( $ this ) ; } $ name = $ index -> getQuotedName ( $ this ) ; $ columns = $ index -> getColumns ( ) ; if ( count ( $ columns ) === 0 ) { throw new InvalidArgumentException ( "Incomplete definition. 'columns' required." ) ; } if ( $ index -> isPrimary ( ) ) { return $ this -> getCreatePrimaryKeySQL ( $ index , $ table ) ; } $ query = 'CREATE ' . $ this -> getCreateIndexSQLFlags ( $ index ) . 'INDEX ' . $ name . ' ON ' . $ table ; $ query .= ' (' . $ this -> getIndexFieldDeclarationListSQL ( $ index ) . ')' . $ this -> getPartialIndexSQL ( $ index ) ; return $ query ; }
Returns the SQL to create an index on a table on this platform.

@param Table|string $table The name of the table on which the index is to be created.

@return string

@throws InvalidArgumentException
Returns the SQL to create an index on a table on this platform .