lib/Doctrine/DBAL/Schema/Table.php
public function setPrimaryKey(array $columnNames, $indexName = false)
    {
        $this->_addIndex($this->_createIndex($columnNames, $indexName ?: 'primary', true, true));

        foreach ($columnNames as $columnName) {
            $column = $this->getColumn($columnName);
            $column->setNotnull(true);
        }

        return $this;
    }
public function setPrimaryKey(array $columnNames, $indexName = false)
    {
        $this->_addIndex($this->_createIndex($columnNames, $indexName ?: 'primary', true, true));

        foreach ($columnNames as $columnName) {
            $column = $this->getColumn($columnName);
            $column->setNotnull(true);
        }

        return $this;
    }
public function setPrimaryKey ( array $ columnNames , $ indexName = false ) { $ this -> _addIndex ( $ this -> _createIndex ( $ columnNames , $ indexName ? : 'primary' , true , true ) ) ; foreach ( $ columnNames as $ columnName ) { $ column = $ this -> getColumn ( $ columnName ) ; $ column -> setNotnull ( true ) ; } return $ this ; }
Sets the Primary Key.

@param string[]     $columnNames
@param string|false $indexName

@return self
Sets the Primary Key .