lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
public function getColumnDeclarationSQL($name, array $field)
    {
        if (isset($field['columnDefinition'])) {
            $columnDef = $this->getCustomTypeDeclarationSQL($field);
        } else {
            $default = $this->getDefaultValueDeclarationSQL($field);

            $charset = isset($field['charset']) && $field['charset'] ?
                ' ' . $this->getColumnCharsetDeclarationSQL($field['charset']) : '';

            $collation = isset($field['collation']) && $field['collation'] ?
                ' ' . $this->getColumnCollationDeclarationSQL($field['collation']) : '';

            $notnull = isset($field['notnull']) && $field['notnull'] ? ' NOT NULL' : '';

            $unique = isset($field['unique']) && $field['unique'] ?
                ' ' . $this->getUniqueFieldDeclarationSQL() : '';

            $check = isset($field['check']) && $field['check'] ?
                ' ' . $field['check'] : '';

            $typeDecl  = $field['type']->getSQLDeclaration($field, $this);
            $columnDef = $typeDecl . $charset . $default . $notnull . $unique . $check . $collation;

            if ($this->supportsInlineColumnComments() && isset($field['comment']) && $field['comment'] !== '') {
                $columnDef .= ' ' . $this->getInlineColumnCommentSQL($field['comment']);
            }
        }

        return $name . ' ' . $columnDef;
    }
public function getColumnDeclarationSQL($name, array $field)
    {
        if (isset($field['columnDefinition'])) {
            $columnDef = $this->getCustomTypeDeclarationSQL($field);
        } else {
            $default = $this->getDefaultValueDeclarationSQL($field);

            $charset = isset($field['charset']) && $field['charset'] ?
                ' ' . $this->getColumnCharsetDeclarationSQL($field['charset']) : '';

            $collation = isset($field['collation']) && $field['collation'] ?
                ' ' . $this->getColumnCollationDeclarationSQL($field['collation']) : '';

            $notnull = isset($field['notnull']) && $field['notnull'] ? ' NOT NULL' : '';

            $unique = isset($field['unique']) && $field['unique'] ?
                ' ' . $this->getUniqueFieldDeclarationSQL() : '';

            $check = isset($field['check']) && $field['check'] ?
                ' ' . $field['check'] : '';

            $typeDecl  = $field['type']->getSQLDeclaration($field, $this);
            $columnDef = $typeDecl . $charset . $default . $notnull . $unique . $check . $collation;

            if ($this->supportsInlineColumnComments() && isset($field['comment']) && $field['comment'] !== '') {
                $columnDef .= ' ' . $this->getInlineColumnCommentSQL($field['comment']);
            }
        }

        return $name . ' ' . $columnDef;
    }
public function getColumnDeclarationSQL ( $ name , array $ field ) { if ( isset ( $ field [ 'columnDefinition' ] ) ) { $ columnDef = $ this -> getCustomTypeDeclarationSQL ( $ field ) ; } else { $ default = $ this -> getDefaultValueDeclarationSQL ( $ field ) ; $ charset = isset ( $ field [ 'charset' ] ) && $ field [ 'charset' ] ? ' ' . $ this -> getColumnCharsetDeclarationSQL ( $ field [ 'charset' ] ) : '' ; $ collation = isset ( $ field [ 'collation' ] ) && $ field [ 'collation' ] ? ' ' . $ this -> getColumnCollationDeclarationSQL ( $ field [ 'collation' ] ) : '' ; $ notnull = isset ( $ field [ 'notnull' ] ) && $ field [ 'notnull' ] ? ' NOT NULL' : '' ; $ unique = isset ( $ field [ 'unique' ] ) && $ field [ 'unique' ] ? ' ' . $ this -> getUniqueFieldDeclarationSQL ( ) : '' ; $ check = isset ( $ field [ 'check' ] ) && $ field [ 'check' ] ? ' ' . $ field [ 'check' ] : '' ; $ typeDecl = $ field [ 'type' ] -> getSQLDeclaration ( $ field , $ this ) ; $ columnDef = $ typeDecl . $ charset . $ default . $ notnull . $ unique . $ check . $ collation ; if ( $ this -> supportsInlineColumnComments ( ) && isset ( $ field [ 'comment' ] ) && $ field [ 'comment' ] !== '' ) { $ columnDef .= ' ' . $ this -> getInlineColumnCommentSQL ( $ field [ 'comment' ] ) ; } } return $ name . ' ' . $ columnDef ; }
Obtains DBMS specific SQL code portion needed to declare a generic type
field to be used in statements like CREATE TABLE.

@param string  $name  The name the field to be declared.
@param mixed[] $field An associative array with the name of the properties
of the field being declared as array indexes. Currently, the types
of supported field properties are as follows:

length
Integer value that determines the maximum length of the text
field. If this argument is missing the field should be
declared to have the longest length allowed by the DBMS.

default
Text value to be used as default for this field.

notnull
Boolean flag that indicates whether this field is constrained
to not be set to null.
charset
Text value with the default CHARACTER SET for this field.
collation
Text value with the default COLLATION for this field.
unique
unique constraint
check
column check constraint
columnDefinition
a string that defines the complete column

@return string DBMS specific SQL code portion that should be used to declare the column.
Obtains DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE .