lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
public function getUniqueConstraintDeclarationSQL($name, Index $index)
    {
        $columns = $index->getColumns();
        $name    = new Identifier($name);

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

        return 'CONSTRAINT ' . $name->getQuotedName($this) . ' UNIQUE ('
            . $this->getIndexFieldDeclarationListSQL($index)
            . ')' . $this->getPartialIndexSQL($index);
    }
public function getUniqueConstraintDeclarationSQL($name, Index $index)
    {
        $columns = $index->getColumns();
        $name    = new Identifier($name);

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

        return 'CONSTRAINT ' . $name->getQuotedName($this) . ' UNIQUE ('
            . $this->getIndexFieldDeclarationListSQL($index)
            . ')' . $this->getPartialIndexSQL($index);
    }
public function getUniqueConstraintDeclarationSQL ( $ name , Index $ index ) { $ columns = $ index -> getColumns ( ) ; $ name = new Identifier ( $ name ) ; if ( count ( $ columns ) === 0 ) { throw new InvalidArgumentException ( "Incomplete definition. 'columns' required." ) ; } return 'CONSTRAINT ' . $ name -> getQuotedName ( $ this ) . ' UNIQUE (' . $ this -> getIndexFieldDeclarationListSQL ( $ index ) . ')' . $ this -> getPartialIndexSQL ( $ index ) ; }
Obtains DBMS specific SQL code portion needed to set a unique
constraint declaration to be used in statements like CREATE TABLE.

@param string $name  The name of the unique constraint.
@param Index  $index The index definition.

@return string DBMS specific SQL code portion needed to set a constraint.

@throws InvalidArgumentException
Obtains DBMS specific SQL code portion needed to set a unique constraint declaration to be used in statements like CREATE TABLE .