src/Database/Migration/Generator/MySqlGenerator.php
protected function getPhinxColumnOptions($phinxType, $columnData, $columns)
    {
        $attributes = [];

        $attributes = $this->getPhinxColumnOptionsNull($attributes, $columnData);

        // default value
        $attributes = $this->getPhinxColumnOptionsDefault($attributes, $columnData);

        // For timestamp columns:
        $attributes = $this->getPhinxColumnOptionsTimestamp($attributes, $columnData);

        // limit / length
        $attributes = $this->getPhinxColumnOptionsLimit($attributes, $columnData);

        // numeric attributes
        $attributes = $this->getPhinxColumnOptionsNumeric($attributes, $columnData);

        // enum values
        if ($phinxType === 'enum') {
            $attributes = $this->getOptionEnumValue($attributes, $columnData);
        }

        // Collation
        $attributes = $this->getPhinxColumnCollation($phinxType, $attributes, $columnData);

        // Encoding
        $attributes = $this->getPhinxColumnEncoding($phinxType, $attributes, $columnData);

        // Comment
        $attributes = $this->getPhinxColumnOptionsComment($attributes, $columnData);

        // after: specify the column that a new column should be placed after
        $attributes = $this->getPhinxColumnOptionsAfter($attributes, $columnData, $columns);

        // @todo
        // update set an action to be triggered when the row is updated (use with CURRENT_TIMESTAMP)
        //
        // For foreign key definitions:
        // update set an action to be triggered when the row is updated
        // delete set an action to be triggered when the row is deleted

        $result = '[' . implode(', ', $attributes) . ']';

        return $result;
    }
protected function getPhinxColumnOptions($phinxType, $columnData, $columns)
    {
        $attributes = [];

        $attributes = $this->getPhinxColumnOptionsNull($attributes, $columnData);

        // default value
        $attributes = $this->getPhinxColumnOptionsDefault($attributes, $columnData);

        // For timestamp columns:
        $attributes = $this->getPhinxColumnOptionsTimestamp($attributes, $columnData);

        // limit / length
        $attributes = $this->getPhinxColumnOptionsLimit($attributes, $columnData);

        // numeric attributes
        $attributes = $this->getPhinxColumnOptionsNumeric($attributes, $columnData);

        // enum values
        if ($phinxType === 'enum') {
            $attributes = $this->getOptionEnumValue($attributes, $columnData);
        }

        // Collation
        $attributes = $this->getPhinxColumnCollation($phinxType, $attributes, $columnData);

        // Encoding
        $attributes = $this->getPhinxColumnEncoding($phinxType, $attributes, $columnData);

        // Comment
        $attributes = $this->getPhinxColumnOptionsComment($attributes, $columnData);

        // after: specify the column that a new column should be placed after
        $attributes = $this->getPhinxColumnOptionsAfter($attributes, $columnData, $columns);

        // @todo
        // update set an action to be triggered when the row is updated (use with CURRENT_TIMESTAMP)
        //
        // For foreign key definitions:
        // update set an action to be triggered when the row is updated
        // delete set an action to be triggered when the row is deleted

        $result = '[' . implode(', ', $attributes) . ']';

        return $result;
    }
protected function getPhinxColumnOptions ( $ phinxType , $ columnData , $ columns ) { $ attributes = [ ] ; $ attributes = $ this -> getPhinxColumnOptionsNull ( $ attributes , $ columnData ) ; // default value $ attributes = $ this -> getPhinxColumnOptionsDefault ( $ attributes , $ columnData ) ; // For timestamp columns: $ attributes = $ this -> getPhinxColumnOptionsTimestamp ( $ attributes , $ columnData ) ; // limit / length $ attributes = $ this -> getPhinxColumnOptionsLimit ( $ attributes , $ columnData ) ; // numeric attributes $ attributes = $ this -> getPhinxColumnOptionsNumeric ( $ attributes , $ columnData ) ; // enum values if ( $ phinxType === 'enum' ) { $ attributes = $ this -> getOptionEnumValue ( $ attributes , $ columnData ) ; } // Collation $ attributes = $ this -> getPhinxColumnCollation ( $ phinxType , $ attributes , $ columnData ) ; // Encoding $ attributes = $ this -> getPhinxColumnEncoding ( $ phinxType , $ attributes , $ columnData ) ; // Comment $ attributes = $ this -> getPhinxColumnOptionsComment ( $ attributes , $ columnData ) ; // after: specify the column that a new column should be placed after $ attributes = $ this -> getPhinxColumnOptionsAfter ( $ attributes , $ columnData , $ columns ) ; // @todo // update set an action to be triggered when the row is updated (use with CURRENT_TIMESTAMP) // // For foreign key definitions: // update set an action to be triggered when the row is updated // delete set an action to be triggered when the row is deleted $ result = '[' . implode ( ', ' , $ attributes ) . ']' ; return $ result ; }
Generate phinx column options.

https://media.readthedocs.org/pdf/phinx/latest/phinx.pdf

@param string $phinxType
@param array  $columnData
@param array  $columns

@return string
Generate phinx column options .