protected function buildGeneralDefinition(TableStructure $table): void
    {
        array_unshift($this->definition, '$this');

        if ($this->isUnsignedPossible && $this->isUnsigned) {
            $this->definition[] = 'unsigned()';
        }

        if ($this->isNotNullPossible && $this->isNotNull) {
            $this->definition[] = 'notNull()';
        }

        if ($this->default !== null) {
            if ($this->default instanceof Expression) {
                $this->definition[] = "defaultExpression('" . $this->escapeQuotes($this->default->expression) . "')";
            } elseif (is_array($this->default)) {
                $this->definition[] = "defaultValue('" . $this->escapeQuotes(Json::encode($this->default)) . "')";
            } else {
                $this->definition[] = "defaultValue('" . $this->escapeQuotes((string)$this->default) . "')";
            }
        }
        if ($this->isPkPossible && !$table->primaryKey->isComposite() && $this->isColumnInPK($table->primaryKey)) {
            $append = $this->prepareSchemaAppend(true, $this->autoIncrement);
            if (!empty($this->append)) {
                $append .= ' ' . $this->append;
            }

            $this->definition[] = "append('" . $this->escapeQuotes((string)$append) . "')";
        } elseif (!empty($this->append)) {
            $this->definition[] = "append('" . $this->escapeQuotes((string)$this->append) . "')";
        }

        if ($this->comment) {
            $this->definition[] = "comment('" . $this->escapeQuotes((string)$this->comment) . "')";
        }
    }
protected function buildGeneralDefinition(TableStructure $table): void
    {
        array_unshift($this->definition, '$this');

        if ($this->isUnsignedPossible && $this->isUnsigned) {
            $this->definition[] = 'unsigned()';
        }

        if ($this->isNotNullPossible && $this->isNotNull) {
            $this->definition[] = 'notNull()';
        }

        if ($this->default !== null) {
            if ($this->default instanceof Expression) {
                $this->definition[] = "defaultExpression('" . $this->escapeQuotes($this->default->expression) . "')";
            } elseif (is_array($this->default)) {
                $this->definition[] = "defaultValue('" . $this->escapeQuotes(Json::encode($this->default)) . "')";
            } else {
                $this->definition[] = "defaultValue('" . $this->escapeQuotes((string)$this->default) . "')";
            }
        }
        if ($this->isPkPossible && !$table->primaryKey->isComposite() && $this->isColumnInPK($table->primaryKey)) {
            $append = $this->prepareSchemaAppend(true, $this->autoIncrement);
            if (!empty($this->append)) {
                $append .= ' ' . $this->append;
            }

            $this->definition[] = "append('" . $this->escapeQuotes((string)$append) . "')";
        } elseif (!empty($this->append)) {
            $this->definition[] = "append('" . $this->escapeQuotes((string)$this->append) . "')";
        }

        if ($this->comment) {
            $this->definition[] = "comment('" . $this->escapeQuotes((string)$this->comment) . "')";
        }
    }
protected function buildGeneralDefinition ( TableStructure $ table ) : void { array_unshift ( $ this -> definition , '$this' ) ; if ( $ this -> isUnsignedPossible && $ this -> isUnsigned ) { $ this -> definition [ ] = 'unsigned()' ; } if ( $ this -> isNotNullPossible && $ this -> isNotNull ) { $ this -> definition [ ] = 'notNull()' ; } if ( $ this -> default !== null ) { if ( $ this -> default instanceof Expression ) { $ this -> definition [ ] = "defaultExpression('" . $ this -> escapeQuotes ( $ this -> default -> expression ) . "')" ; } elseif ( is_array ( $ this -> default ) ) { $ this -> definition [ ] = "defaultValue('" . $ this -> escapeQuotes ( Json :: encode ( $ this -> default ) ) . "')" ; } else { $ this -> definition [ ] = "defaultValue('" . $ this -> escapeQuotes ( ( string ) $ this -> default ) . "')" ; } } if ( $ this -> isPkPossible && ! $ table -> primaryKey -> isComposite ( ) && $ this -> isColumnInPK ( $ table -> primaryKey ) ) { $ append = $ this -> prepareSchemaAppend ( true , $ this -> autoIncrement ) ; if ( ! empty ( $ this -> append ) ) { $ append .= ' ' . $ this -> append ; } $ this -> definition [ ] = "append('" . $ this -> escapeQuotes ( ( string ) $ append ) . "')" ; } elseif ( ! empty ( $ this -> append ) ) { $ this -> definition [ ] = "append('" . $ this -> escapeQuotes ( ( string ) $ this -> append ) . "')" ; } if ( $ this -> comment ) { $ this -> definition [ ] = "comment('" . $ this -> escapeQuotes ( ( string ) $ this -> comment ) . "')" ; } }
Builds general methods chain for column definition.
@param TableStructure $table
Builds general methods chain for column definition .